I need some help with the .htaccess I have many search engines pointing to and need to point to the root FROM http://yoursite.com/viewtopic.php?f=29&t=290&p=688 TO http://yoursite.com I would like a rewrite rule to the ROOT. currently I have - not working # redirect all traffic to RewriteCond {HTTP_HOST} ^yoursite.com/viewtopic.php?f=29&t=290&p=688% [nc] RewriteRule {HTTP_HOST} http://yoursite\.com/public {REQUEST_URI} [R=permanent,L] Code (markup):
May have solved it.... RewriteCond %{HTTP_HOST} ^domainname.com$ [OR] RewriteCond %{HTTP_HOST} ^www.domainname.com$ RewriteRule ^viewtopic\/?(.*)$ "http\:\/\/domainname\.com\/public\/$1" [R=301,L] RewriteCond %{HTTP_HOST} ^domainname.com$ [OR] RewriteCond %{HTTP_HOST} ^www.domainname.com$ RewriteRule ^viewtopic\.php\/?(.*)$ "http\:\/\/domainname\.com\/public\/$1" [R=301,L] RewriteCond %{HTTP_HOST} ^domainname.com$ [OR] RewriteCond %{HTTP_HOST} ^www.domainname.com$ RewriteRule ^viewtopic\.php\/?(.*)$ "http\:\/\/domainname\.com\/public\/$1" [R=301,L] Code (markup):
Just to make sure I read that clearly, they're linking to: http://yoursite.com/viewtopic.php?f=29&t=290&p=688 and you want it to link to: http://yoursite.com/ ? If that's the case this should do the trick: RewriteCond %{QUERY_STRING} ^f=29&t=290&p=688$ RewriteRule ^viewtopic\.php$ /? [R=301,L] Code (markup):