Answer the question
In order to leave comments, you need to log in
Why doesn't mod_rewrite work on the site root?
I have such a .htaccess setting, at addresses like /asda/asda/ and others, the redirect works as expected, but if you just open site.ru/ then app.php does not work, instead the apache welcome page is spit out. Tell me if it's not difficult.
I spent a couple of hours at first with what I thought mod_rewrite did not work at all, but it turned out to work, just not on the main page... uff...
Thank you!
<IfModule mod_rewrite.c>
RewriteEngine On
Options +FollowSymlinks
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php?u=$1 [L,QSA]
</IfModule>
Answer the question
In order to leave comments, you need to log in
DirectoryIndex app.php
<IfModule mod_rewrite.c>
…
For the root, index.html, php, etc. are searched. Specify app.php as the index file
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question