www.sub.domain.gen.tc -> sub.domain.gen.tc

Using a single web hosting account to host multiple sites

www.sub.domain.gen.tc -> sub.domain.gen.tc

Postby overflow » Fri Dec 22, 2006 4:27 am

Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.)?(www|mail|img)\.domain\.gen\.tc
RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.domain\.gen\.tc
# ok rewrite now
RewriteRule ^/(.*)$ http://%2.domain.gen.tc/$1  [P,L]



Error log
[Fri Dec 22 11:39:04 2006] [error] [client XXX.XXX.XXX.XXX] attempt to make remote request from mod_rewrite without proxy enabled: proxy:http://sub.domain.gen.tc/

Access log
gen.tcbined

or


Code: Select all
...
RewriteRule ^/(.*)$ http://%2.domain.gen.tc/$1  [L,R=301]



browser
The page isn't redirecting properly

what's the problem?
overflow
 
Posts: 19
Joined: Thu Oct 12, 2006 2:02 am
Location: Turkey

Postby richardk » Fri Dec 22, 2006 11:30 am

You can't use the P flag because you don't have mod_proxy enabled.

When you redirect, the pattern (the optional www. part) is matching the new URL (without the www.) and redirecting in a loop:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^(www\.)?(www|mail|img)\.domain\.gen\.tc$ [NC]
RewriteCond %{HTTP_HOST} ^www\.([^\.]+)\.domain\.gen\.tc$ [NC]
RewriteRule ^/(.*)$ http://%1.domain.gen.tc/$1  [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby overflow » Fri Dec 22, 2006 12:50 pm

Thanks for your help
overflow
 
Posts: 19
Joined: Thu Oct 12, 2006 2:02 am
Location: Turkey


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 36 guests

cron