Forum Moderators: phranque
I tried this...but is not working
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
#handle domain.com wildcard subdomains
rewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-]+).domain.com [NC]
rewriteRule ^(.*)$ /domain.com/$1 [L]
Isn't possible to setup server alias with .htaccess , some tricks i don't know... to make it work
You did not post what you expected it to do, so it's rather difficult to diagnose the problem.
Also, can we assume that you have defined these wildcard subdomains in your DNS zone file, and that your server is configured to 'deliver' requests for these subdomains to the filespace where your .htaccess code resides?
If not, then you'll need to do those things first, or you will get "Server not found" errors from your browser, no connection to your server will be made, and so the code will never be executed.
Jim
i want any test.mydomain.com or test2.mydomain.com to be resolved to mydomain.com ( any fictive subdomain ) to point to my main domain
the provider has itself wildcard , any wildcard i try is resolved to his page not mydomain.com, mydomain.com or www.mydomain.com works but can't trick the wilcard to point to my own page not their page
no , i see the error 404 page of the host
If the server had answered with a page from your site, it would have meant that all traffic, regardless of the host header, was directed to the same virtualhost in the apache config. This would have allowed you to rewrite based on elements of the resquest.