index.asp to /home if query_string empty

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 32
Joined: 14 Apr 2012, 07:28

index.asp to /home if query_string empty

11 May 2012, 07:42

Hi,

it might be a very easy issue but I cannot get it working:

what rule do I need to set up to send www.domain.com/index.asp to www.domain.com/home

the rule should only fire if there is nothing appended to index.asp like index.asp?a=1, so in fact if {query_string} is empty.

I tried this and many other possibilities to no avail:

Code: Select all
RewriteCond %{REQUEST_URI} ^/index\.asp$ [NC]
RewriteCond %{QUERY_STRING} ^$ [NC]
RewriteRule ^/$ home [NC,R=301,L]


Thx for the help,
Pascal

User avatar
Posts: 32
Joined: 14 Apr 2012, 07:28

Re: index.asp to /home if query_string empty

11 May 2012, 18:11

doh...

Code: Select all
RewriteCond %{QUERY_STRING} ^$ [NC]
RewriteRule ^index\.asp$ /home [NC,R=301,L]

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 1 guest