...

View Full Version : Subdomain Redirect WWW



Jazzo
09-11-2010, 01:07 AM
I'm trying to set up a subdomain to redirect to a directory. I'm also trying to make it so that it will redirect www. I have this:

RewriteEngine On

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

RewriteCond %{HTTP_HOST} subdomain.domain.com
RewriteRule ^(.*)$ directory/$1 [L]

but it's not working. It get a 500 Internal Server error for subdomain.domain.com and www.subdomain.domain.com is not found. Any help is appreciated.

Thanks,
Julian

Jazzo
09-11-2010, 01:53 AM
Update: I messed around with it, and now, no matter what, subdomain.domain.com becomes an infinite redirect. I have no idea what's going on.

Blue_Jeans
09-11-2010, 03:24 AM
If I understand you correctly, you want something like code.google.com to redirect to google.com/code?


RewriteBase /

RewriteCond %{HTTP_HOST} ^code.google.com [nc]

RewriteRule ^(.*)$ http://www.google.com/code/$1 [r=301,nc]

I THINK that should work.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum