Redirect all pages to specific page

Fix it!!

Redirect all pages to specific page

Postby masisso » Tue Jan 30, 2007 6:43 am

I'm creating an "Under Construction" page and I want to
redirect all pages except "under_construction.html" to "under_construction.html". Trick is I want all my images and css to still work.

This doesn't work because images/css are also redirected.

Options +FollowSymLinks
RewriteEngine on

# if requested resource doesn't exist
RewriteRule ^(.+) /under_construction.php
Posts: 3
Joined: Tue Jan 30, 2007 6:35 am

Postby richardk » Tue Jan 30, 2007 11:20 am

.html or .php? The below uses html, you'll want to change both occurances to php if thats what you wanted.

Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule !^(under_construction\.html|.*\.(css|js|bmp|jpe?g|gif|png))$ /under_construction.html [L]
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Return to Security with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 1 guest