?
Solved

Allow Images to show on htaccess redirect page.

Posted on 2009-04-18
5
Medium Priority
?
698 Views
Last Modified: 2013-12-25
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

0
Comment
Question by:pettiger15
  • 2
4 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 24177986
Why not just embed the image using a full URL?

<img src="http://www.somedomain.com/someimage.jpg" />
0
 

Author Comment

by:pettiger15
ID: 24178835
You mean embed the image in the .htaccess file?
0
 
LVL 43

Accepted Solution

by:
David S. earned 2000 total points
ID: 24180670
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
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 24181074
>> RewriteCond %{REQUEST_URI} !\.(gif|jpg|jpeg|png)$  [NC]

Ah.  I did misunderstand the issue.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question