Some time ago I used it to rewrite ugly .php links to nicer ones. Let's assume I only defined a simple index.html -> index.php rule.
Now I want to get rid of old URLs also when users directly type them, I want that when someone point its browser to /index.php, he will be visually redirected (302) to /index.html and display the page. So I tried something like:
Code: Select all
# Mod Rewrite init
RewriteEngine on
RewriteBase /
# First rule (it works alone)
RewriteRule ^index\.html$ index.php [L,QSA]
# Second rule for redirect old urls to new ones
RewriteRule ^index\.php$ index.html [R=302,L,QSA]How can I achive the behaviour I want?