Laravel & IIS rewrites

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.

About Nick

Melbourne based web developer that loves building front-end systems with anything from vanilla JS to React. Infosec student and active learner. Subscribe to the blog

www ·

One thought on “Laravel & IIS rewrites”

  1. Brendan

    Thanks for posting this, it really helped

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.