- Code: Select all
RewriteRule ^cat/([^/\.]+)/?$ /cat.php?titleid_cat=$1 [L]
It works fine for making my long URLS, short and friendly, but recently i've been trying to figure out how to make this a permanent redirect.
I have tried
- Code: Select all
RewriteRule ^cat/([^/\.]+)/?$ /cat.php?titleid_cat=$1 [R=301,L]
The rule works, but not as i intended. Instead it seems to divert (redirect) me to the original long (php? etc) URL.
1. Should the code be written something like (below) in order for a link to always divert to the new URL, rather than the old?
- Code: Select all
RewriteRule ^cat.php?titleid_cat=$1 /cat/([^/\.]+)/?$ [R=301,L]
In other words, the other way around?
2. or do i write a seperate rule, which redirects old url to new?