Forum Moderators: phranque

Message Too Old, No Replies

subdomain redirect

subdomain redirect

         

tandiono

7:28 am on Sep 29, 2005 (gmt 0)



Hi! im new here. I hope i post at the right thread.. anyway how can i make my subdomain redirect to other site?

something like this : free.blobal.com
sdsd.blobal.com
kewwefrw.blobal.com

whatever is type in for the subdomain it will always redirect to just blobal.com

is there a way to set it?

Im using Cpanel. Thanks :)

zulu_dude

8:40 am on Sep 29, 2005 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi, welcome to WW!

The best way of doing this is to use something called mod-rewrite in apache. Not sure how your hosting is set up, but you need to have access to a file called .htaccess

In there, something similar to this might work:

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

(Taken from this thread [webmasterworld.com])

You might also want to read this excellent introduction to mod-rewrite [webmasterworld.com]

tandiono

11:24 pm on Sep 29, 2005 (gmt 0)



# -FrontPage-

IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.blabla.com
AuthUserFile /home/vom/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/vom/public_html/_vti_pvt/service.grp

Hi! My .htaccess is look like something like this, so do i have to copy paste this code


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

to my .httacess?

Thanks :)