Hello everyone,
I got one issue, been working on it for hours and didnt find the solution so I am pretty tired now.
Ive tried to rewrite and redirect dynamic urls on my site with 2 variables in htaccess. My link was:
website.com/index.php?id=123&n=name
I used this code:
RewriteRule ^([^/]+)_([^/]+)$ /index.php?id=$1&n=$2 [NC]
And I get this link:
website.com/123_name
Id like to get this link:
website.com/name
but its hard or me, so I kept it that way, it could work.
The problem is, I want old link to redirect to new, which is such a problem I cannot solve.
I tried this:
RewriteCond %{QUERY_STRING} ^id=(.+)&n=(.+)$
RewriteRule . http://example.com/%1_%2? [R=301,L]
But there is an error.
Could anyone help?
Thanks
[edited by: jatar_k at 1:09 pm (utc) on Nov 5, 2011]
[edit reason] changed url to stop autolinking for readable rule [/edit]