Allow Images to show on htaccess redirect page.

Hello, I have a website that I wanted to work on and display a maintenance page for visitors except for me so i can be the only one who can view it. I have tried several codes for the .htaccess file but my problem is that on the maintenance page I want to display has an image but of course it is block because of the .htaccess file. How can I use a maintenance page and still be able to display an image? Is there any way to allow an exception to the .htaccess file?
 This is the code I am using now.
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} !^98\.219\.84\.255
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteRule ^(.*)$ http://gadgetblvd.com/maintenance.html [R=307,L]

Open in new window

pettiger15Asked:
Who is Participating?
 
David S.Connect With a Mentor Commented:
It seems that Jason is under the impression that using a full URL will make a difference. It won't.

You need to add another condition to your rule.

Try this:
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} !^98\.219\.84\.255
RewriteCond %{REQUEST_URI} !\.(gif|jpg|jpeg|png)$  [NC]
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteRule ^(.*)$ http://gadgetblvd.com/maintenance.html [R=307,L]

Open in new window

0
 
Jason C. LevineNo oneCommented:
Why not just embed the image using a full URL?

<img src="http://www.somedomain.com/someimage.jpg" />
0
 
pettiger15Author Commented:
You mean embed the image in the .htaccess file?
0
 
Jason C. LevineNo oneCommented:
>> RewriteCond %{REQUEST_URI} !\.(gif|jpg|jpeg|png)$  [NC]

Ah.  I did misunderstand the issue.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.