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 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: redirect 404 errors
Author
Message |
Seik
Newbie


Joined: 04 March 2011
Posts: 8
Posted: 29 March 2011 at 3:17am

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

Thanks very much ���
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 29 March 2011 at 3:37am

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
 
CFadm
Newbie


Joined: 29 December 2011
Location: France
Posts: 1
Posted: 29 December 2011 at 10:18am

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
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 03 January 2012 at 5:10am

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
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
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