This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: redirect 404 errors Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Seik
Newbie
Newbie


Joined: 04 March 2011
Online Status: Offline
Posts: 8
Posted: 29 March 2011 at 3:17am | IP Logged Quote Seik

What rule I need to redirect 404 errors to a custom page, For example: error.asp?

Thanks very much ���
Back to Top View Seik's Profile Search for other posts by Seik
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 29 March 2011 at 3:37am | IP Logged Quote Anton

If you are using ISAPI_Rewrite v2, then it won't be that easy.
You'll need to have the rule which checks whether or not it's a physical file/folder. Like this:

[ISAPI_Rewrite]

RewriteRule /(?!(?:images/|css/js/|index.php|etc)).* /error.asp [I,RP]

But if you have a change to use ISAPI_Rewrite 3, the solution will be much more straightforward.

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
CFadm
Newbie
Newbie


Joined: 29 December 2011
Location: France
Online Status: Offline
Posts: 1
Posted: 29 December 2011 at 10:18am | IP Logged Quote CFadm

I need to do the same with ISAPI_Rewrite 3.

I'd be interrested to know the solution for this version even more if it's more straightforward !

Back to Top View CFadm's Profile Search for other posts by CFadm
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 03 January 2012 at 5:10am | IP Logged Quote Anton

In v3 it's as simple as:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .? /error.asp? [R=301,L]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 

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