Php - Is it possible to block access to a webpage depending on the address used? -
consider following scenario.
there site on local network can accessed 1 of 2 ways:
- 11.11.11.111/testsite (ip)
- test.site.com (vhost)
is possible php allow access using test.site.com?
edit:
while there many suggestions how solve problem, went publi design & john v.'s mod_rewrite suggestion, implemented in httpd.conf file , redirected forbidden page.
what worked me was:
rewriteengine on rewritecond %{http_host} !^test.site.com$ [nc] rewriterule .? - [f]
i avoid php request , go 1 level. haven't tried this, maybe .htaccess
file you, using similar this:
rewriteengine on rewritecond %{http_host} !^11.11.11.111/testsite$ [nc] rewriterule ^(.*)$ test.site.com/$1 [l,r=301]
you might have play around it, imagine along lines should want be.
Comments
Post a Comment