Search code examples
iisisapi-rewrite

Create a 301 redirect using ISAPI Rewrite for IIS


I have created this one and it works,

RewriteRule shoppingcart.aspx ViewCart.aspx [NC,R=301]

I'm trying to get this to work,

RewriteRule search.aspx?advanced=1 AdvancedSearch.aspx [NC,R=301]

Not sure if i'm supposed to use a rewrite condition, or if the code i'm using will even work, I'm new to this so any help would be great

thanks.


Solution

  • I believe it's ISAPI_Rewrite 3 you are using, so the code should be:

    RewriteCond %{QUERY_STRING} ^advanced=1$ [NC]
    RewriteRule search\.aspx AdvancedSearch.aspx? [NC,R=301,L]