Jump to content

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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.

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...