Htaccess Subdomain to domain redirect

I am reworking a site and I am trying to move a forum from a subdomain (board.example.com) to the main domain where example.com/index.php/forums/ will be used

I have set my htaccess file like this:

RewriteEngine On  
RewriteCond %{HTTP_HOST} ^(.*).example.com  
RewriteRule ^(.*)$ http://www.example.com/index.php/forums/ [R=301,L]

      

which works, but for all content that has already been indexed by search engines, the new urls show up with old links like

example.com/index.php/forums/?p=1199&sid=4daeb5acf7983a0f8d56737c4812f474

Is there a way to clear up the bit that is added to the end of the new URL?

+2


source to share


1 answer


I don't know where your sid parameter comes from ...

How could I try it first (before resorting to mod_rewrite):



<VirtualHost *>
  ServerName board.example.com
  Redirect permanent / http://www.example.com/index.php/forums/
</VirtualHost>

      

+1


source







All Articles