![]() |
|
Customer Support
Can I have a catch-all subdomain?
You can always create any subdomain (anything.yourdomain.com) that you want by creating a directory or symbolic link in your /htdocs directory as described here.However, if you want a browser to be able to get to your site no matter what subdomain they requested (wwww.yourdomain.com or even anyname.yourdomain.com) without having setup specific directories or symlinks for those requests in advance, then you can use mod_rewrite to redirect their request for a non-existent mis-typed or random subdomain to a valid page at on your website.
To do this, create a text file named .htaccess in your /htdocs directory that contains the following 5 directives, one per line with no other linebreaks (the lines may appear to wrap in your browser now), where each line begins Rewrite...
RewriteEngine on
RewriteCond %{HTTP_HOST} ^([a-z0-9]+)\..+\..*$ [NC]
RewriteCond /full/path/to/homedirectory/htdocs/%1 !-d
RewriteCond /full/path/to/homedirectory/htdocs/%1 !-l
RewriteRule ^(.*)$ http://www.yourwebsite.com/ [L,NS]
where "/full/path/to/homedirectory" is the full path to your home directory as described after the 2nd paragraph here, and where "www.yourwebsite.com" leads to an area of your website for which you have properly created files in your /htdocs/www directory.
User-Contributed Notes |
|||
|
|||
|
|||
|
|||
|
|
|||
Related Questions:
Why does it say "directory not empty" when I try to remove a directory?
How do I create subdomains?
How do I get Shell access to the server?
Where do I put my webpages and files?
How do I upload and edit my files?
Why do I keep getting old copies of my pages when I just updated and changed my files?
How do I change my password?
When will my site be activated?
How do I get to one of my subdomains from a temp.modwest.com or secure.modwest.com URL?
Can I switch my domain name or alter my administrator username?
How do I recreate the "_" symlink that directs mydomain.com to www.mydomain.com?
Why do I Get an Error Page When Accessing Webmail with Internet Explorer?
What kind of resource limits do you have for your shared hosting environment?
What do I need to know about the different environment introduced in May 2009?
How do I create multiple identities when sending via Modwest webmail?
I need help with Plesk on my VPS or Managed Server!
Does Modwest charge for "domain parking?"
Why does my php_error_log say that my site is missing the XML library?
What is the real full path to my home directory?
How do I make a one-click unsubscribe link in Listserv?
I need to make a copy of my site and download it without using FTP
Browse Categories:Getting Started, FTP, Telnet/SSH, Moving Domains, E-mail, Traffic Reports, Mailing Lists, Apache, PHP, CGI, Other Server-Side Scripting, MySQL Database, Imaging Libraries, Other Software, Billing & Terms, Control Panel, E-commerce, Pre-Sales |

