Forum Moderators: phranque
I tried this line in my .htaccess file:
redirect 301 /folder.php?id=1 http://www.example.com/books.html
but it just seems to ignore it. Other simple tests like this one work fine:
redirect 301 /123 http://www.example.com/books.html
Currently google has an assortment of php URLs indexed and cached - and I want to make sure it eventually crawls and caches my new .html versions of these pages so I can get rid of the dynamic .php version.
I did get one version of it working which redirected ALL urls which had /folder.php in it to the same final destination - but I want to ensure that the old Google indexed URL to my 'books' page for example will still go to my new static HTML 'books' page.
Thanks for tips, help or pointers to documentation.
Jeanne
[edited by: tedster at 4:15 am (utc) on Jan. 11, 2006]
[edit reason] use example.com in code [/edit]
Welcome to WebmasterWorld!
The Redirect family of directives in Apache mod_alias doesn't handle query strings. So you'll need to use mod_rewrite if your host allows you to do so:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^id=1$
RewriteRule ^folder\.php$ /books.html [L]
Jim