.htaccess rewritealmost works

Discussion in 'Apache' started by CrashGordon, Sep 5, 2012.

  1. #1
    On my site, I have a subdomain that I wish to prevent direct access to.The following entry redirects anyone who types http://sub.domain.com back to the index of the parent domain, but it does not redirect requests for http://sub.domain.com/index.php . What must I add to include that, as well?RewriteEngine onRewriteCond %{HTTP_REFERER} !^http://(.+\.)?domain\.com/ [NC]RewriteRule ^$ http://sub.domain.com/redirect.php [R]Thanks in advance for any help. I realize I'm a neophite that has only gotten this far by finding examples and trying them till I find one that works.
     
    CrashGordon, Sep 5, 2012 IP