SuperNoob: redirect entire domain

Using a single web hosting account to host multiple sites

Postby starkmann » Tue Feb 20, 2007 12:05 pm

Richard,

Unfortunately, the same result.
I tried placing the deeper files as you suggested.
I also tried switching QSA to R. I had no result.
starkmann
 
Posts: 9
Joined: Wed Feb 14, 2007 9:57 am

Postby richardk » Tue Feb 20, 2007 1:49 pm

If you replace the mod_rewrite with
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule Google http://www.google.com/? [NC,R,L]

and go to /Google do you get redirected to Google?

Also try
Code: Select all
DirectoryIndex index.html
Options +FollowSymLinks -MultiViews

RewriteEngine On

RewriteCond %{DOCUMENT_ROOT}/domainA%{REQUEST_URI}/ -d [OR]
RewriteCond %{DOCUMENT_ROOT}/domainB%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]

RewriteCond %{HTTP_HOST} ^(www\.)?domainA\.org$ [NC]
RewriteRule ^domainA(/.*)?$ /domainA%{REQUEST_URI} [QSA,L]

RewriteCond %{HTTP_HOST} ^(www\.)?domainB\.(com|net)$ [NC]
RewriteRule ^domainB(/.*)?$ /domainB%{REQUEST_URI} [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby starkmann » Wed Feb 21, 2007 4:08 am

the google thing works

I tried the second bit of code and when I put that in I get that there is no index file in the directory, which there is an index file in the two folders it is pointing to. I retyped the url and directory names a couple time just to make sure it wasn't a typo but got the same result everytime.
starkmann
 
Posts: 9
Joined: Wed Feb 14, 2007 9:57 am

Postby richardk » Wed Feb 21, 2007 6:00 am

Remove
Code: Select all
DirectoryIndex index.html


Try adding %{DOCUMENT_ROOT} before /domainA and /domainB in the RewriteRules.

If that doesn't work, i don't know what's wrong, you could try asking your host.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby starkmann » Wed Feb 21, 2007 6:39 am

just to verify, my code looks like

Code: Select all
Options +FollowSymLinks -MultiViews

RewriteEngine On

RewriteCond %{DOCUMENT_ROOT}/amosfamily%{REQUEST_URI}/ -d [OR]
RewriteCond %{DOCUMENT_ROOT}/trainingsyndicate%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]

RewriteCond %{HTTP_HOST} ^(www\.)?amosfamily\.org$ [NC]
RewriteRule ^domainA(/.*)?$ %{DOCUMENT_ROOT}/amosfamily%{REQUEST_URI} [QSA,L]

RewriteCond %{HTTP_HOST} ^(www\.)?trainingsyndicate\.(com|net)$ [NC]
RewriteRule ^domainB(/.*)?$ %{DOCUMENT_ROOT}/trainingsyndicate%{REQUEST_URI} [QSA,L]


If that is all correct, then darn. Ah well. I appreciate your help.
I contacted my host before I contacted you , they want to sell me a solution that involves the use of frames, which don't work well or for me to pay for a whole separate user account. I think maybe it's time to find a new host.
Again, thanks for your help. I do appreciate it.
starkmann
 
Posts: 9
Joined: Wed Feb 14, 2007 9:57 am

Postby richardk » Wed Feb 21, 2007 8:35 am

Oops, i see a few problems
Code: Select all
Options +FollowSymLinks -MultiViews

RewriteEngine On

RewriteCond %{DOCUMENT_ROOT}/amosfamily%{REQUEST_URI}/ -d [OR]
RewriteCond %{DOCUMENT_ROOT}/trainingsyndicate%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]

RewriteCond %{HTTP_HOST} ^(www\.)?amosfamily\.org$ [NC]
RewriteRule !^amosfamily(/.*)?$ %{DOCUMENT_ROOT}/amosfamily%{REQUEST_URI} [QSA,L]

RewriteCond %{HTTP_HOST} ^(www\.)?trainingsyndicate\.(com|net)$ [NC]
RewriteRule !^trainingsyndicate(/.*)?$ %{DOCUMENT_ROOT}/trainingsyndicate%{REQUEST_URI} [QSA,L]


Try that, then try removing the %{DOCUMENT_ROOT}s in the RewriteRules.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Previous

Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 89 guests

cron