NameSilo

Mod rewrite with subdomains

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
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
Close
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
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back