.htaccess www to non-www redirect problem
I have multi-site drupal installed in sub directories and I'm trying to redirect www to non-www if I type in
If you go to lvl deeper such as colorgenetics.info/equine/forum it redirects to colorgenetics.info/forum
Even more confusing is the fact that if I go to
This maybe a combination of issues since I have a gallery2 embeded in drupal and that may be causing some of the problems.
A sample of the gallery redirect rules
#equine gallery rewrite rules
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
RewriteCond %{REQUEST_URI} !/equine/index\.php$
RewriteRule . - [L]
RewriteCond %{THE_REQUEST} /equine/d/([0-9]+)\-([0-9]+)/([^/?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/equine/index\.php$
RewriteRule . /equine_gallery/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3 [QSA,L]
RewriteCond %{THE_REQUEST} /equine/gallery/v/([^?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/equine/index\.php$
RewriteRule . /equine/index.php?q=gallery&g2_path=%1 [QSA,L]
and the stuff that handles the sub-directories
#rewrite subdomains to subdirectories
#rewrite www to without www
RewriteCond %{HTTP_HOST} ^www\.colorgenetics\.info$ [NC]
RewriteRule ^(.*)$ http://colorgenetics.info/$1 [L,R=301]
#rewrite subdomains to subdirectories
RewriteCond %{HTTP_HOST} ^feline\.colorgenetics\.info$ [NC]
RewriteRule ^(.*)$ http://colorgenetics.info/feline/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^canine\.colorgenetics\.info$ [NC]
RewriteRule ^(.*)$ http://colorgenetics.info/canine/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^equine\.colorgenetics\.info$ [NC]
RewriteRule ^(.*)$ http://colorgenetics.info/equine/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/feline/(.*)$
RewriteRule ^(.*)$ /feline/index.php?q=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/canine/(.*)$
RewriteRule ^(.*)$ /canine/index.php?q=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/equine/(.*)$
RewriteRule ^(.*)$ /equine/index.php?q=$1 [L,QSA]
thanks for the help
2 Replies
I'm trying my best to learn some of this stuff but most of it is still over my head. I hope I have everything in the right order. I have the boost rules first, 2nd the gallery ones, third the sub-domain rewrite rules, and then the drupal rules to write everything to index.php. I'm not sure exactly where in the scheme of things the sub-domain rewrite rules are supposed to go but I've tried moving them and it either broke the sub-domain rewrites or kept things the same.
I'm completely baffled as to why equine.colorgenetics.info/forum will redirect as it is supposed to to colorgenetics.info/equine/forum but
I also tried adding
RewriteCond %{HTTP_HOST} ^www.colorgenetics.info\feline$ [NC]
RewriteRule ^(.*)$
or
RewriteCond %{HTTP_HOST} ^www.colorgenetics.info/feline$ [NC]
RewriteRule ^(.*)$
But neither of those did anything
RewriteCond %{HTTP_HOST} ^www.colorgenetics.info$ [NC]
RewriteRule ^(.*)$
from my .htaccess file. I would rather have a user access via the www sub-domain then be redirected to a url that doesn't exist.
I still don't understand why feline.colorgenetics.info/forum well be rerouted correctly to colorgenetics.info/feline/forum while
I still have boost disabled for the site.