Hi Please Could anyone help me sort out my problem, I have read all the thread but still do not find how things work. I have website with dynamic urls like : http://www.domain.com/books.php?id=about&srch=12 want to redirect them to http://www.domain.com/novels/ I set a .htacess file with the following : -------------- Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{QUERY_STRING} ^id\=([^&]+)\&srch\=([^&]+)$ RewriteRule ^$ /novels/ [R=301,L] --------------- But when loading the page it is still the same Would appreciate your help Thanks Angelina
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^books.php?id\=([^.]+)\&srch\=([^.]+)$ http://www.domain.com/novels/ [R=301,L] For just a rewrite, you can't do RewriteRule ^novels/$ books.php?id=$1&srch=$2 [L] cause you can't give every single page the same URL. More like RewriteRule ^novels/id/([^.]+)/search/([^.]+)$ books.php?id=$1&srch=$2 [L]
Thank you for your prompt reply. I still unabel to fix it. In fact since i am going to change the structure of the website, i am looking on how to redirect all the dynamic Urls to the index page, so I can take advantage of the PR of the old Urls. So i would like to have ALL urls like : http://www.domain.com/books.php?id=about&srch=1 http://www.domain.com/books.php?id=about&srch=2 http://www.domain.com/books.php?id=about&srch=3 .... have permanent redirection to http://www.domain.com/english/home.php thanks for your precious advice. Angelina
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^books\.php?id\=(.*)\&srch\=(.*)$ http://www.domain.com/english/home.php [R=301,L] If that doesn't do it, I don't know what will. Dynamic redirects arn't very friendly.
Hi Nintendo The point is to make a SEO friendly move, so what would you suggest in order to take advantage of the old Urls PR? Thanks for your patience Angelina
If the pages are already indexed, changing the URLs is the LAST thing to do. You're supposed to change them BEFORE the search engines find them.
HI again I tried to add this code my .htaccess file but unfortunately the urls are still teh same Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^books\.php?id\=(.*)\&srch\=(.*)$ http://www.domain.com/english/home.php [R=301,L] Code (markup): Regards Angelina
Just as I guessed. It's hopeless. Apache doesn't like redirecting dynamic URLs very well. You're toast. Next time you make a site, change the URLs FIRST, not after you got the site indexed in search engines and have PR.
This will teach me how to think well before building any new website in the future. thanks for your patience Angelina