Hi guys,
I am new here and new to apache. I have been searching all over the web and I thought you guys could help me out.
I have several sub domains where it may be easy to mistype. I therefore setup a wildcard DNS so my site catches everything with my domain. The problem is I want to alert people they made a mistake. Currently the wildcard sends you to my homepage but I would like to send wrong url's to an “error” page letting people know they should check their typing.
I have a wildcard DNS and I would like mistyped or wrong urls directed to the error.php page rather than to the home page. All urls are currently re written without the www so I am using the following code to accomplish this.
RewriteCond %{HTTP_HOST} ^www\.(.+)$
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
For example: demo is an active subdomain so if demo.domain.com or www.demo.domain.com is typed you will go to the proper page (being demo.domain.com since I am eliminating all www) but if demmmmo.domain.com (or www version) is typed you will go to the error.php page.
I would appreciate any help as I have been going crazy tring to figure this out.
Thanks,
John