mvpzone Posted August 21, 2004 Posted August 21, 2004 Folks I wanted to know if any of you have experiences in setting up a catch all sub-domain. To give an example: 1. I have a domain **** 2. I want all requests to *.**** to land at www.**** I thought i could handle this via a rewrite rule (simplified) #To redirect any subdomain to www RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.mydomain\.com [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/(.*) *****/$1 [L,R=permanent] Added this to my .htaccess at my docroot and does not seem to work. Any pointers... Cheers Quote
purplespider Posted August 21, 2004 Posted August 21, 2004 Don't know much about .htaccess but could using a Redirect rule work? Such as "Redirect *.**** ****" (Along those lines anyway, don't know the correct syntax) James Quote
mvpzone Posted August 22, 2004 Author Posted August 22, 2004 Looks like i am not in luck. In my Cpanel i see that i have an option to redirect at resource level http://****/foo.html ----> http://****/bar.html I do not see a possibility to set it up at sub-domain level. i do not want to create any sub-domain just want to catch requests to any sub-domain and route them to www.**** I tried creating a sub-domain with name * and it failed with an exception that stated could not resolve this to an IP Quote
TCH-Rick Posted August 22, 2004 Posted August 22, 2004 I did note that you submitted a Help Desk ticket and the alias was set for you on the server. Please note that if you make any changes to subdomains through CPanel it will break the alias. Quote
mvpzone Posted August 22, 2004 Author Posted August 22, 2004 Thanks for the addtional tip Rick. I do not have any plans to create an additional sub-domain yet. Nevertheless i will keep this in mind when i intend to create one. Does this mean when i have to create a dedicated sub-domain, i will not have a working catch-all or is it that the manual intervention on the server will have to be redone (to function for the non-existent sub-domains). Cheers. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.