Slim framework - cannot interpret routes with dot

后端 未结 4 905
离开以前
离开以前 2020-12-19 13:46

Problem Statement

I\'m currently working on an internal RESTful API, and I\'m using our main domain name as an environment identifier. However, I noticed that Slim

4条回答
  •  独厮守ぢ
    2020-12-19 14:12

    Root issue - PHP Development server

    After playing with different Slim conditions and experiments, I started to look closer at the server level and making sure that the URL was passed correctly to the Slim routes.

    Turns out this was an issue with PHP's development server, which is available through the php -S command.

    A quick google search revealed that several others had encountered the same issue, and it was a server issue, rather than a bug in Slim.

    Solution

    To test out my solution, I ran MAMP, and transferred all my files over. And then I wrote the .htaccess to redirect all requests through to index.php.

    The moment of truth:

    I typed in localhost:8888/campaigns/demo.com/12 and a wave of joy surged through my veins as I saw a line of beautiful, gorgeous demo.com/12 written across the browser! (I have an echo statement for that particular route) A week-plus of troubleshooting and tinkering around has finally bore fruit!

    Celebratory Hoorah!

    \(^O^)/ Hoorah for Apache!

    Thanks for your help @adosaiguas!

提交回复
热议问题