How can you create wildcard subdomains?

myst23

New member
Joined
May 14, 2007
Messages
1
Basically I want to redirect all 404 traffic from *.mydomains.com/* to a specific page..

How can I do this?
Do I need to create wildcard subdomains?
 
Basically I want to redirect all 404 traffic from *.mydomains.com/* to a specific page..

How can I do this?
Do I need to create wildcard subdomains?

I have the same problem, do you already got a solution ?

Thanks in advance.
 
Sending a 2xx (OK) or 3xx (redirect) code for any non-existing page is not RFC and is very, very bad for search engine indexing and ranking.
You could just use mod_rewrite, checking if the file doesn't exist and redirecting to another page (internally, 2xx response code, or remotely, 3xx code) but I strongly suggest against both ways.

What most people do is creating a custom 404.shtml file with a delayed redirect (using HTTP meta data or javascript). Even a small delay (1-3 seconds) is fine, what's important is that the 404 error code is delivered.

For the "wilcard domain" matter, just add "ServerAlias www.domain.example *.domain.example" to the virtualhost. (not tested)
 
Last edited:
Back
Top