If you are currently working on a site, say at a subdomain sub.example.com, and would like to have all traffic going there redirected to example.com/page.html, but you still want to be able to access sub.example.com, you can use these htaccess commands:
This is useful e.g. when you are constructing a site and have already started advertising the address, but don't want it visible to anyone except yourself.Code:# Where you want to redirect to ErrorDocument 403 http://example.com/page.html order deny,allow # You want everyone blocked deny from all # Except for your IP (replace with your IP) allow from 60.118.156.100
Note: this is a made up IP in the code. Also, dydns domains don't work, since Apache uses reverse lookup to find the domain, so your PTR records must be correct if you're using a domain.


2Likes
LinkBack URL
About LinkBacks



Reply With Quote
icon below! (this is even better than "liking" a post)
