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

Using a single web hosting account to host multiple sites

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

Postby overflow » Thu Oct 12, 2006 2:40 am

Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST}                ^www.domain.gen.tc(:80)?$
RewriteRule ^/(.*)                 http://$1.domain.gen.tc/ [L,R=301]


http://www.domain.gen.tc/sub/ -> http://sub.domain.gen.tc/

but http://www.domain.gen.tc/ -> http://.domain.gen.tc/ :(

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

Postby richardk » Thu Oct 12, 2006 9:00 am

Maybe you want this:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

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

Postby overflow » Sun Oct 15, 2006 2:08 am

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 33 guests

cron