Forum Moderators: phranque
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.
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