Last Updated: February 25, 2016
·
645
· dja4mower

htaccess Redirect to a Single Page

# SINGLE-PAGE REDIRECT <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000 RewriteCond %{REQUEST_URI} !/your-page.html$ [NC] RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC] RewriteRule .* /your-page.html [R=302,L] </IfModule>

Update your-page.html to the page you would like to redirect to

Example - redirect to index.html

# INDEX.HTML-PAGE REDIRECT <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000 RewriteCond %{REQUEST_URI} !/index.html$ [NC] RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC] RewriteRule .* /index.html [R=302,L] </IfModule>