5

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?

3 Answers 3

3

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 
Sign up to request clarification or add additional context in comments.

Comments

2

you can use

RewriteEngine On RewriteRule ^test$ test.php 

Comments

0

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.