Hi, I need some help with mod_rewrite engine. What i want to do is redirect all pages that are accessed with index.php?/topic/xxxx(xxxx being topic name) on domain1 to redirect to another domain say domain2.com The reason is i used to run IPB forum on domain1 that i moved to domain2, google still thinks the forums exists and brings visits with the url. I can't do a full domain redirection because i run a site on domain1 and so it would become unviewable with domain redirection. PS: the urls in case you need them are domain1 = http://deviatedhacking.com , and domain2 = http://forums.deviatedhacking.com
All you need to know is here: http://httpd.apache.org/docs/current/mod/mod_rewrite.html The 301 redirect is so google knows it's permanently moved. It will eventually stop indexing the old domain and start indexing the new one. e.g. RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.deviatedhacking\.com$ [NC] RewriteRule ^(.*)$ http://forums.deviatedhacking.com /$1 [R=301,L] RewriteCond %{HTTP_HOST} ^deviatedhacking\.com$ [NC] RewriteRule ^(.*)$ http://forums.deviatedhacking.com /$1 [R=301,L]
I know how to make simple redirection, the problem was moving ONLY those pages that were accessed with index.php?/topic/. Anyway, its solved using PHP function. Thanks for replying anyway.