I would like to modify my htaccess to :
- Redirect all *.php calls to app.php (SEO call to keep ranking from migration)
- Avoid redirection loop excluding app.php for rewrite rule above.
I ended up with this :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !app.php$
RewriteRule ^(.*).php?$ /app.php/ [R=301,L]
[...]
</IfModule>
But this produces a 404 on test url like http://example.com/sqdlkqjsdlsqk.php
What’s wrong in here?
Regards,
2
Answers
You should be using this rule without trailing slash after
app.php
:Make sure to clear browser cache before testing this change.
Check this out. Make sure to clear your cache.