Results 1 to 6 of 6
Hi,
I hosted my site on Apache web server.
I wanted to redirect all the users request to a HTML page(maintenance page).
I used the below rewrite rule to do ...
- 10-05-2010 #1Just Joined!
- Join Date
- Oct 2010
- Posts
- 1
Need help with rewrite rule
Hi,
I hosted my site on Apache web server.
I wanted to redirect all the users request to a HTML page(maintenance page).
I used the below rewrite rule to do ths same.
RewriteEngine on
RewriteRule .* /maintenance.html
The maintenance.html page contains an image.
When ever I try to access my site(during maintenance),I am being redirected to the maintenance.html page.But, I am unable to see the image.
Any help would be grateful.....
Thanks,
Srikanth Bodakunta
- 10-05-2010 #2
You could create a directory "maintenance"
and then place maintenance.html and picture in there.
The Rewrite Rule would then work via negation
RewriteRule ! ^/maintenance/(.*) /maintenance/maintenance.html
Also, you might want to add maintenance.html to DirectoryIndex.You must always face the curtain with a bow.
- 10-07-2010 #3Just Joined!
- Join Date
- Oct 2010
- Posts
- 1
Hi Irithori,
I have tried using the rewite rule you have suggested.But, it still does not work.
I actually wanted all requests to be redirected to the maintenace.html,except the image that I have tried using in the maintenace.html.
Below is the Rewrite rule
RewriteEngine on
RewriteRule !^image.jpg /maintenance.html
RewriteRule .* /maintenance.html
Thanks,
Srikanth Bodakunta.
- 10-07-2010 #4
That rule doesnt make sense
RewriteRule !^image.jpg /maintenance.htm
And my advice requires to have a directory "maintenance" that contains maintenance.html and the image,
as I have written.
If you do not want to have the maintenance directory,
then this might work
Code:RewriteCond %{REQUEST_URI} !^/maintenance.html [OR] RewriteCond %{REQUEST_URI} !^/image.jpg RewrtiteRule ^/.* /maintenance.htmlLast edited by Irithori; 10-07-2010 at 12:41 PM.
You must always face the curtain with a bow.
- 10-07-2010 #5Just Joined!
- Join Date
- Oct 2010
- Posts
- 1
Thanks a lot.....it worked for me.....
- 10-07-2010 #6
Which version, if I may ask?
You must always face the curtain with a bow.


Reply With Quote
