catch all rule

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 6
Joined: 09 Apr 2012, 14:58

catch all rule

09 Apr 2012, 15:05

Hello All,

I have a number of rules within my .htaccess file (see extract below). What im looking to do is add a new rule that would allow some kind of catch all. If none of the above rules have been matched, I would like to send a user to another page

RewriteRule ^([A-Za-z0-9-]+).html$ main.aspx?pagename=$1 [L,QSA]
#CATCHALL HERE:
catchapp.aspx

How would I go about achieving this?

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: catch all rule

10 Apr 2012, 05:54

Hello,

Well, you use a rule at the bottom of your .htaccess that would state:

Code: Select all
RewriteRule .* /catchapp.aspx [NC,R=301,L]

Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 0 guests