Unstoppable Domains

Mod rewrite with subdomains

Spaceship Spaceship
Watch

gamex

Established Member
Impact
7
My host set up a wildcard subdomain, now all I need to do is get my mod rewrite to work.

Let me explain

I have a wildcard subdomain set up, and its folder is http://www.mydomain.com/wildcard/

The wildcard sub is set up for an addon domain, whose folder is http://www.mydomain.com/domaintwo/

I have the following code, I thought it wuold work, but its not

PHP:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^([^.]+)\.domaintwo\.com
RewriteRule ^$ http://www.domaintwo.com/folder/userpage.php?id=%1

The problem is is that its trying to look for that page in http://www.mydomain.com/wildcard/folder/userpage.php?id= instead of http://www.domaintwo.com/folder/userpage.php

Any ideas?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Nevermind, I fixed it:

PHP:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^([^.]+)\.domaintwo\.com
RewriteRule ^(.*)$ http://www.domaintwo.com/folder/userpage.php?id=%1 [R=301,L]
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back