Reputation: 2465
Is there a possibility to redirect requests for example.com/test
to example.com/test.php
for a particular file using .htaccess
, leaving all other files/extensions intact?
Upvotes: 5
Views: 1425
Reputation: 1311
You can try this : RewriteRule ^test$ /test.php [L]
place it above your generic redirection written for all site url.
Like for example :
RewriteRule ^test$ /test.php [L] --page wise condition
RewriteRule ^/?$ "http\:\/\/example\.com\/" [R=301,L] -- generic for site
RewriteRule ^(.[^\.]*)$ index.php?$1 [QSA,L] -- generic for site
Upvotes: 3
Reputation: 335
Yes,
All you do is put this right at the beginning of your .htaccess file
RewriteRule ^test test.php [L]
The [L] means it will honor this line and ignore any subsequent lines.
So put all other URL rewrites after this one.
Upvotes: 0