Forum Moderators: phranque
For example, www.example.com/home.php?cat=62
Redirecting to this:
[example.com...]
I tried regular redirect 301, but it didn't work. I also tried a few other methods, but probably had the syntax wrong. Can anyone assist me in what is the proper procedure?
Thank you.
[edited by: rogerd at 6:51 pm (utc) on Feb. 17, 2005]
[edit reason] Please use example.com for all URL illustrations [/edit]
Welcome to WebmasterWorld!
This recent thread [webmasterworld.com] and the references cited in our forum Charter [webmasterworld.com] will help you get started.
Jim
and also
RewriteEngine On
RewriteRule ^whatever\/whatever\.php\?a=11$ http://www.example.com/newfile.html [R=301,L]
but nothing worked.
[edited by: jdMorgan at 4:13 pm (utc) on Feb. 17, 2005]
[edit reason] Removed specifics per TOS. [/edit]
A query string is not part of a URL. Rather, it is data to be passed to a resource (script) at that URL. So, RewriteRule cannot 'see' the query string, and you must use RewriteCond to test it.
For example:
RewriteCond %{QUERY_STRING} ^cat=([0-9]+)
RewriteRule /home\.php$ http://www.example.com/Sample-Packages-c-[b]%1[/b].html [R=301,L]
Note that you may need to preface this code with
Options +FollowSymLinks Jim