Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Sep 11, 2011 7:19 pm 
Offline
Junior Member

Joined: Tue Jul 05, 2011 8:56 am
Posts: 22
Location: http://colorgenetics.info
I'm having a bit of trouble redirecting my site.

I have multi-site drupal installed in sub directories and I'm trying to redirect www to non-www if I type in www.colorgenetics.info it will redirect to the non-www site but If i type something like www.colorgenetics.info/feline itstead of redirecting to colorgenetics.info/feline it redirects to the base colorgenetics.info

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 www.colorgenetics.info/equine/gallery/v/dilutions it doesn't redirect at all but retains the www

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
Code:
#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

Code:
#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

_________________
Color Genetics


Top
   
 Post subject:
PostPosted: Mon Sep 12, 2011 11:25 am 
Offline
Junior Member

Joined: Tue Jul 05, 2011 8:56 am
Posts: 22
Location: http://colorgenetics.info
I decided it would be better to post my entire .htaccess file. So here it is

http://pastebin.com/zvFaq1Gu

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 www.colorgenetics.info/equine/forum redirects to colorgenetics.info/forum

I also tried adding
RewriteCond %{HTTP_HOST} ^www\.colorgenetics\.info\feline$ [NC]
RewriteRule ^(.*)$ http://colorgenetics.info/feline/$1 [L,R=301]

or

RewriteCond %{HTTP_HOST} ^www\.colorgenetics\.info/feline$ [NC]
RewriteRule ^(.*)$ http://colorgenetics.info/feline/$1 [L,R=301]

But neither of those did anything

_________________
Color Genetics


Top
   
 Post subject:
PostPosted: Mon Sep 12, 2011 11:09 pm 
Offline
Junior Member

Joined: Tue Jul 05, 2011 8:56 am
Posts: 22
Location: http://colorgenetics.info
for the moment I have removed the

RewriteCond %{HTTP_HOST} ^www\.colorgenetics\.info$ [NC]
RewriteRule ^(.*)$ http://colorgenetics.info/$1 [L,R=301]

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 www.colorgenetics.info/feline/forum will be rerouted to colorgenetics.info/forum

I still have boost disabled for the site.

_________________
Color Genetics


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group