check symbol: question mark

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 5
Joined: 17 Jan 2013, 04:19

check symbol: question mark

22 May 2013, 03:56

Hi All,

I want to set up the rule for removing the question mark.

For example:
http://www.testing.com/shop.aspx?query=abc => http://www.testing.com/shop/query=abc

syntax:
RewriteRule ^shop.aspx\?(.*) /shop/$1 [NC,L,R=301,O]

but it doesn't work.

Is there anyone can help me?

Thanks a lot!

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

Re: check symbol: question mark

22 May 2013, 15:29

Hello,

Since everything after '?' is considered as a querystring, we suggest you try the following syntax:

Code: Select all
Rewriteengine on
RewriteBase /

RewriteCond %{QUERY_STRING} ^(.+)$
RewriteRule ^shop\.aspx$ /shop/%1 [NC,L,R=301]


The syntax you tried to use suits ISAPI_Rewrite 2, not 3.

Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 14 guests