If you’re having trouble with Laravel routes not responding on an IIS server follow these steps to make your app work.
- Go to your url and see if it 404s (mywebsite.com/my_route)
- If yes try going to the url with index.php appending to the route name (mywebsite.com/index.php/myroute)
Okay, if that worked you’re having a rewrite issue, which is something we can definitely fix. I had this issue and was afraid I would have to rewrite URLs by myself. Doing that could have issues with controller actions. If your site still does not work with the previous URL structure you’ve got a different issue that this article does not cover.
- Download the URL Rewrite tool for IIS
- Enter the tool and use the import .htaccess file ability to import the Laravel .htaccess file. If that file doesn’t exist just create a local Laravel installation and import that .htaccess file.
- Done, your IIS server will now recognize your Laravel routes and you can continue building your app on your server.
1 comment
Thanks for posting this, it really helped