Handy .Htaccess codes

Redirect

What this does is it takes you from domain.com to the folder support.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule ^/?$ "http\:\/\/www\.domain\.com\/support" [R=301,L]
Restricted Area

This will only allow spcific ip addresses

ErrorDocument 503 "RESTRICTED AREA "
RewriteEngine On
# TO ALLOW YOURSELF TO VISIT THE SITE, CHANGE 111 222 333 444 TO YOUR IP ADDRESS.
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$

RewriteRule .* – [R=503,L]

Author: Chris

Leave a Reply

Your email address will not be published.