Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: Website maintenance page Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
poison77
Newbie
Newbie


Joined: 09 July 2008
Online Status: Offline
Posts: 5
Posted: 09 July 2008 at 9:31am | IP Logged Quote poison77

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 View poison77's Profile Search for other posts by poison77
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 350
Posted: 09 July 2008 at 9:54am | IP Logged Quote Vyacheslav

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 View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
poison77
Newbie
Newbie


Joined: 09 July 2008
Online Status: Offline
Posts: 5
Posted: 13 July 2008 at 1:24am | IP Logged Quote poison77

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 View poison77's Profile Search for other posts by poison77
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 350
Posted: 14 July 2008 at 5:38am | IP Logged Quote Vyacheslav

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 View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
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