How do I deny access to invalid web subdomains with .htaccess?

Posted by Gravitas on Stack Overflow See other posts from Stack Overflow or by Gravitas
Published on 2010-03-08T00:15:24Z Indexed on 2010/03/08 0:17 UTC
Read the original article Hit count: 306

Filed under:

The following .htaccess file does not work:

SSLrequireSSL

RewriteEngine on
RewriteCond %{HTTP_HOST} !^secure\.neuralfutures\.com [NC]
RewriteRule (.*) - [F]

I'm trying to prevent access to anything but "https://secure.neuralfutures.com/docs/", i.e. "https://www.neuralfutures.com/docs/" will fail.

I also seem to be running into caching issues: if I upload the new .htaccess with CuteFTP, then do a file refresh in FireFox, it doesn't seem to have any effect on the output at all. I can tell this because if I comment out SSLrequireSSL, it still disallows a http:// request.

© Stack Overflow or respective owner

Related posts about .htaccess