Topic: Website maintenance page
|

|
| Author |
|
poison77 Newbie

Joined: 09 July 2008
Online Status: Offline Posts: 5
|
| Posted: 09 July 2008 at 9:31am | IP Logged
|
|
|
Hi,
We are using ISAPI Rewrite filter on our site and we have a maintenance page (/maintenance.php).
Now, we want temporarry redirect all the requests (html,php,aspx) to our domain, except the media files (css,ico,jpg,gif,png,swf,js,exe), using 302 redirect.
I tried this rule, it does redirect, but it also redirects all the media files:
RewriteRule ^(?!maintenance.php|(?:\.(?:js|exe|ico|gif|jpg|swf|png|css))).*$ /maintenance.php [R=302,L,RP]
Please help.
Thank you.
|
| Back to Top |
|
| |
Vyacheslav Moderator Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 350
|
| Posted: 09 July 2008 at 9:54am | IP Logged
|
|
|
Hi poison77!
Please try this solution:
Code:
RewriteCond %{REQUEST_FILENAME} ^(?:[^/]+)\.(js|exe|ico|gif|jpg|swf|png|css)? [NC] RewriteRule . - [L] RewriteRule ^(?!maintenance.php)(.*) /maintenance.php [NC,R=302,L]
|
|
|
__________________ Kind regards!
Vyacheslav.
|
| Back to Top |
|
| |
poison77 Newbie

Joined: 09 July 2008
Online Status: Offline Posts: 5
|
| Posted: 13 July 2008 at 1:24am | IP Logged
|
|
|
Hi
Vyacheslav,
That works, but the images and css files on maintenance page are not loaded. Actually all the files are redirected to that maintenance page.
Thanks for your help.
|
| Back to Top |
|
| |
Vyacheslav Moderator Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 350
|
| Posted: 14 July 2008 at 5:38am | IP Logged
|
|
|
Hi poison77!
Please try this solution:
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(?!maintenance\.asp)(.*)$ maintenance.asp [NC,R=302,L,QSA] |
|
|
Edited by Vyacheslav - 14 July 2008 at 5:38am
__________________ Kind regards!
Vyacheslav.
|
| Back to Top |
|
| |
|
|
If you wish to post a reply to this topic you must first login
If you are not already registered you must first register
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum
|