Quote from: sal at Apr 23, 2009, 03:39 AM
Quote from: hquadrat at Apr 22, 2009, 10:43 PM
Mmmmh, I think since 0.9.6.3 the default MODx .htaccess includes a rewrite rule that always redirects either to the www. or the non-www subdomain for SEO reasons (google requested to decide for one or the other a while ago; a.f.a.i.c.r. for duplicate content issues).
Of course this behaviour collides with the subsites hack, you have to think of a solution before the subsites modification can work.
I’m sure that block is quoted out in the default .htaccess file but the best way round it if you wish to enable this (advised) is to only match "www" requests then redirect them to the non-www URL (this is probably how it works currently). If using only different domains rather than sub-domains, you can add several rules to tidy them all up.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.company1\.com$ [NC]
RewriteRule ^(.*)$ http://company1.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.company2\.com$ [NC]
RewriteRule ^(.*)$ http://company2.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.company3\.com$ [NC]
RewriteRule ^(.*)$ http://company3.com/$1 [R=301,L]
This rule is used for several parked domains I have which also have wildcard DNS set for them. For example, www.dearapp.com will be pushed to the non-www version, but oh.dearapp.com works fine.
I was being a bit slow, I now know what you mean. I put the following into my .htaccess and it works great with the subdomains:
RewriteCond %{HTTP_HOST} ^www\.high-rollercasinos\.com$ [NC]
RewriteRule ^(.*)$
http://high-rollercasinos.com/$1 [R=301,L]
The only slight problem is that the main site now defaults to
http://high-rollercasinos.com and I want it to be www.high-rollercasinos.com or does it not make any difference to seo/serps etc. Is this possible some how? Sorry if this is really obvious to everyone but I’m not so confident with redirects etc.
BTW I have disabled it for now until I get an answer to the question but I can re-enable it if someone needs to check it out before helping me.
I alos have a slight problem in that the subfolders still form part of the address. E.g before I would have www.high-rollercasinos.com/Norsk/Poker-Rom etc and now I have no.high-rollercasinos.com/Norsk/Poker-Rom when what I want is no.high-rollercasinos.com/Poker-Rom i.e to strip away the subfolder part. Again I assume this is fairly easy but after trawling round the internet I’m just getting more andmore confused, please help.