Hi
I am using this code to try and redirect all visitors to a maintenance page but it doesn't display any images.
<Limit GET POST PUT>
order deny,allow
deny from all
allow from 123.456.789
allow from 123.456.789
</LIMIT>
ErrorDocument 403 /custom-message.html
<Files custom-message.html>
order allow,deny
allow from all
</Files>
How can I modify the code to allow it to display the images on the maintenance page?
Thanks
You should try using something like this instead.
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REMOTE_HOST} !^123\.45\.67\.89
RewriteCond %{REQUEST_URI} !/custom-message\.html$
RewriteRule \.html$ /alternate_page.html [R=302,L]
You may still need to modify it to fit your specific needs.
reference: http://www.webmasterworld.com/forum92/167.htm
Thanks Jonathan. I ended up using a plugin.
I'd still be interested in getting it to work via htaccess so I'll give this a try.
:)
MickeyRoush
Member
Posted 5 months ago #
If the previous rules don't help you could try this which is a bit simpler and uses %{REMOTE_ADDR} instead of %{REMOTE_HOST}. It also assumes that you are using/referencing an image.
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^(123\.45\.67\.89|213\.45\.67\.89)
RewriteCond %{REQUEST_URI} !/custom-message\.html$
RewriteCond %{REQUEST_URI} !/custom-message\.png$
RewriteRule .* /custom-message\.html [R=307,L]