Forum Moderators: buckworks & webwork

Message Too Old, No Replies

Redirect parked domains

         

Nissemus

12:24 pm on Jan 28, 2004 (gmt 0)



I found this code in an earlier thread for redirecting parked domains to my main site:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST}!^www\.yourdomain\.net
RewriteCond %{HTTP_HOST}!^123\.45\.67\.89
RewriteRule ^(.*)$ http://www.yourdomain.net/$1 [R=permanent,L]

It works, but it makes my subdomains inaccessable. Is there any way around this?

yowza

4:22 am on Jan 29, 2004 (gmt 0)

10+ Year Member



I don't have the answer, but if you asked this question in the Apache forum, I'm sure they could help.

You could also research mod_rewrite and do it yourself. However, mod_rewrite can have a steep learning curve.

canuck

7:53 am on Jan 29, 2004 (gmt 0)

10+ Year Member



Nissemus, you need one more RewriteCond line in there (or one for each subdomain if you have more than one)... similar to line 3, except replace the 'www' with 'subdomain'

- canuck

ruler

8:01 pm on Feb 2, 2004 (gmt 0)

10+ Year Member



I think you would like something like this.

RewriteEngine On
RewriteRule ^(.*)$ [yourdomain.com...] [L]

Works for me using subdomains, and any page on the domain.

Thanks