I have this in my .htaccess
file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
It rewrites both, http://www.site
to http://site
, and site
to site/app.php
I also want to rewrite site/index.php
to site/app.php
.
How can I do it?
When I request /index.php
I get a 404 response.
I've tried to rename app_dev.php
to index.php
en my local host, but doesn't work. I've done the next change in .htaccess
:
order allow,deny
allow from all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^(.*)$ /app_dev.php [QSA,L] #line deleted
RewriteRule ^(.*)$ /index.php [QSA,L] #line added
</IfModule>
and rename the file app_dev.php
to index.php