Forum Moderators: phranque

Message Too Old, No Replies

htaccess subdomain?

htaccess subdomain?

         

besturkonline

10:18 am on Feb 27, 2005 (gmt 0)



Here's what I have in .htaccess, which is under my root directory:

RewriteEngine on
RewriteCond %{HTTP_HOST}!^(www\.)?thesitename\.com [NC]
RewriteCond %{HTTP_HOST} ^(.*)\.thesitename\.com [NC]
RewriteRule .* /test.php?name=%1 [L]

What I need to do is like this:
If www.thesitename.com or thesitename.com is entered, doing nothing.
If abc.thesitename.com, 123.thesitename.com, etc. are entered, the users will be redirected to the test.php page under the root, where I'll parse the subdomain name using name=%1.

After I modified the .htaccess file and loaded the test.php to the site, I got The page cannot be displayed page with Cannot find server or DNS Error if I type [aaa.thesitename.com....] But if I only type aaa.thesitename.com, I was redirected to the error page from www.overture.com that I've no connection to.

I've no idea what is happening here. Please help. Thanks.

jdMorgan

4:27 pm on Feb 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to inform the DNS system that you are adding subdomains to your domain. You can add them one-at-a-time, or you can use "wildcard" DNS, creating a new A-record in your zone file that points *.your_domain.tld to your server's IP address. Try a search for 'wildcard DNS' for more info.

The Overture redirect is because you apparently have Overture set as your default search page if a DNS error is encountered by your browser. If you didn't install that function intentionally, then it's probably time to run Ad-Aware, SpyBot Search & Destroy, and Hijack This to remove browser hijacks, search page redirects, ad-ware, and spyware.

Jim