Forum Moderators: phranque

Message Too Old, No Replies

Problem with subdomain and htaccess file

         

alexo

11:06 pm on May 19, 2006 (gmt 0)

10+ Year Member



Hello

2 years ago i set 301 redirect(htaccess) from non www version to www version

something like this

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

today i need to set up subdomain on this domain, and check that my subdomain is redirected to www.domain.com/subdomain/

hmm ..

is there any way, (may be some additional code to add), and get subdomain.domain.com instead of domain.com/subdomain/

thanks

alexo

8:01 pm on May 22, 2006 (gmt 0)

10+ Year Member



any advise will be appreciated

alexo

8:16 pm on May 28, 2006 (gmt 0)

10+ Year Member



btw

what do u think about this code


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

seems, that redirect is working and have abulity to have subdomain.domain.com

eeek

6:08 am on Jun 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Assuming you are using Apache just put the rewrite rules inside the <VirtualHost> tags.