Forum Moderators: phranque
http://www.example.com/treatment/?q=node/110
to:
http://www.example.com/treatment/the-new-file.html
So far I have this in an htaccess located in the treatment folder but cannot get it to work as intended:
RewriteEngine On
RewriteRule ^(*.)q=node/110$ http://www.example.com/treatment/the-new-file.html [R=301,L]
Any help would be appreciated.
[edited by: jdMorgan at 1:08 pm (utc) on June 5, 2007]
[edit reason] example.com [/edit]
in /treatment/.htaccess:
RewriteCond %{QUERY_STRING} ^q=node/110$
RewriteRule ^$ http://www.example.com/treatment/the-new-file.html? [R=301,L]
RewriteCond %{QUERY_STRING}<>the-new-file.html ^q=node/110<>(.+)$ [OR]
RewriteCond %{QUERY_STRING}<>2nd-new-file.html ^q=node/111<>(.+)$ [OR]
RewriteCond %{QUERY_STRING}<>3rd-new-file.html ^q=node/112<>(.+)$
RewriteRule ^$ http://www.example.com/treatment/%1.html? [R=301,L]
The "<>" characters are arbitrary, serving only to demarcate the query string/replacement URL-path boundary. Note that there is no [OR] flag on the last RewriteCond in the list.
Jim