s.domain.com/s/1.txt -> www.s.domain.com/1.txt

Using a single web hosting account to host multiple sites

s.domain.com/s/1.txt -> www.s.domain.com/1.txt

Postby pipix » Tue Sep 11, 2007 4:39 am

How to redirect

something.domain.com or www.something.domain.com

to

something.domain.com/<content of "something folder"> and www.something.domain.com/<content of "something folder">


Thank you very much.
pipix
 
Posts: 4
Joined: Wed Jun 20, 2007 5:24 am

Postby richardk » Tue Sep 11, 2007 11:26 am

So you want sub.domain.com/* to www.sub.domain.com/*? (in a .htaccess file in sub.domain.com's document root)
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby pipix » Tue Sep 11, 2007 12:14 pm

Thank you veryyyy much :) You are mod_rewrite master :)

One more time, thank you! :D
pipix
 
Posts: 4
Joined: Wed Jun 20, 2007 5:24 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 3 guests

cron