MyBB Community Forums

Full Version: cant get canonical rewrite rule to work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,

I am trying to get the canonical rule below to work (with my URL instead of the below) however it just seems to be ignored.

RewriteEngine on
rewritecond %{http_host} ^domain.net/forums [nc]
rewriterule ^(.*)$ http://www.domain.net/forums/$1 [r=301,nc]

This should be just doing a 301 redirect of all http://mydomain
to
http://www.mydomain

However when I call mydomain.net/forum it does not get redirected to www

Any ideas?

I am using the google SEO plugin and I am sure this may have something to do with it. I don't want to use [L] on these because it still needs to call the rest afterwards right?

Dan

Oh found the issue. it was my rewrite rule, changed it to

RewriteCond %{HTTP_HOST} !^www\. [NC]
Your rewritecond says to only rewrite URLs under /forums
(2013-06-11, 08:36 PM)laie_techie Wrote: [ -> ]Your rewritecond says to only rewrite URLs under /forums

yep, that is the point of that rewrite rule. It's canonical for the forums directory only. The main directory is Joomla and has its only canonical.

All good