MyBB Community Forums

Full Version: .htaccess subdomain that doesn't exist?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
now I know I can make a 404 page with .htaccess and what not

but what about a subdomain that doesn't exist? example as in: 3451.example.com

but then it redirects to the error404.000webhost.com/? and I dont want users to be redirected there when they should be on my site still it's just counterproductive. any ideas? thanks It doesn't even have to redirect to my homepage, just as long as it doesn't bring up any other website, it could give me an error for all I care, I just don't want it to go to another site.
Create a wild card DNS such as:

 *.yourforum.com

Then write some .htaccess condition like:


RewriteCond %{HTTP_HOST} ^([a-z0-9-]+).yourforum.com/$1 [NC]
RewriteRule ^(.*)$ http://yourofurm.com/404/ [R=404,L]