My website is build using HTML code and Cpanel. So how to set up a 404 page? I have already done mydomain.com/adasdasd ------ that redirects to my 404 page. But what about asdasdas.mydomain.com------- that does not redirect to my 404 page. How to fix that??????/
asdasdas.mydomain.com is a subdomain of mydomain.com and, technically, a completely different domain than mydomain.com. If you want subdomain.mydomain.com to direct to a 404 page (or anywhere else) you will have to do that with mod_rewrite. This is fairly simple if you only have one subdomain. But if you have a wildcard A record in your zone file, it becomes a bit more complicated. Here is how you fix the problem as described: In the root web space for asdasdas.mydomain.com put this in an .htaccess file: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^asdasdas\.mydomain\.com$ RewriteRule ^/(.*) http://mydomain.com/$1 [NC,R] Code (markup):
Because the same problem happened to me. I simply placed two shtml files in my sub domain redirecting to 404 error pages successfully
The OP already has a 404 on his primary domain and he wants to redirect his subdomains to that 404 page. shtml is used to tell the server the page uses SSI (server side includes). (http://en.wikipedia.org/wiki/Server_Side_Includes) shtml has nothing to do with 404 pages or with redirecting pages.
I can get that fixed for you for free. PM me and I will do that instantly. Thanks, Best Regards, Team - Elite.