Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rider0211's avatar

Laravel website works only with index.php in url on iis server

Hi @all I deployed the laravel website to iis server. But I have a problem. The problem is that works only with index.php in url. for example:

localhost:80/ ------------------works well localhost :90/login --------------not working localhost:80/index.php/login------works well

I though the reason is .htaccess. so I have been trying to find the way to fix this problem for a week. But no more result works well. I found the way works by others in this platform.

DirectoryIndex index.php

Options -MultiViews
RewriteEngine On

RewriteCond %{REQUEST_URI}:: ^(/.+)/(.*)::$
RewriteRule ^(.*) - [E=BASE:%1]

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index\.php(/(.*)|$) %{ENV:BASE}/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]

RewriteRule .? %{ENV:BASE}/index.php [L]

But this htaccess doesn't work on iis. E and ENV are not supported thing on iis. I want you to help me. thanks.

0 likes
2 replies

Please or to participate in this conversation.