RewriteCond QUERY_STRING not working on server

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 9
Joined: 12 Feb 2013, 10:01

RewriteCond QUERY_STRING not working on server

31 Jul 2013, 09:23

**Apologies, the characters in the subject of my previous post seem to have caused a problem with accessing the views and responses**

I have been working locally to set up rules to forward users accessing a specific URL to another. This was all working fine locally. When I transferred the rules to our live environment they just don't trigger. Could there be differences in the set up? I am unaware of any. All other rules work ok, it appears to be the ones using %{QUERY_STRING}. Here is the rule which doesn't work on live:

Code: Select all
RewriteCond %{HTTP:Host} http://www.domain.co.uk
RewriteCond %{QUERY_STRING} ^group=36$
RewriteRule ^/research/index\.php$ http\://www.domain.co.uk/research.php?view=az#adipose [NC,R=301,L,NE]


The following rule however, works fine both locally and on live:
Code: Select all
RewriteCond %{HTTP:Host} http://www.domain.co.uk
RewriteRule ^/research_nephropathy\.php$ http\://www.domain.co.uk/research.php?view=az#diabeticnephropathy [NC,R=301,L,NE]


Many thanks for any advice.

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

Re: RewriteCond QUERY_STRING not working on server

31 Jul 2013, 09:32

Hello,

There's only one problem I can see with the rule. The Host condition should look:


Code: Select all
RewriteCond %{HTTP:Host} ^www\.domain\.co\.uk$ [NC]



We would also suggest using [NC] flag with the quey_string condition.

But if these fixes don't help, please, enable logging and provide us with the rewrite.log for a testing request. Logging issues are described here - http://www.helicontech.com/forum/10648-FAQ.html

Regards
Andrew

User avatar
Posts: 9
Joined: 12 Feb 2013, 10:01

Re: RewriteCond QUERY_STRING not working on server

31 Jul 2013, 11:29

Thank you, I have updated my rules and it has unfortunately not fixed the problem. I have turned the rewrite.log on but it got to 5mb in seconds. I went to the URLs in question but they don't appear to have been listed in the rewrite.log file. I have turned the logging off again. How would you like the file?

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

Re: RewriteCond QUERY_STRING not working on server

31 Jul 2013, 13:29

In case you didn't find /research/index.php?group=36 in the rewrite.log, than we do not need this log.
Please, take a look at the error.log. Do you have any entry about the .htaccess from the root of this site being loaded correctly?

Regards
Andrew

User avatar
Posts: 9
Joined: 12 Feb 2013, 10:01

Re: RewriteCond QUERY_STRING not working on server

01 Aug 2013, 07:25

Hi Andrew, yes, there are a few lines which indicate this:

[01/08/2013 10:42:17] path\to\helicon\ISAPI_Rewrite3\httpd.conf - Loaded successfully

Most of the lines follow the following pattern with changes to the date:

[01/08/2013 10:44:19] ISAPI Filter loaded. Version 3.1.0.96. Followed by server information

I've noticed there is a slight difference in version. My local machine is using Version 3.1.0.98. I'm investigating as to whether we can upgrade the server version.

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

Re: RewriteCond QUERY_STRING not working on server

01 Aug 2013, 09:46

Sorry, youre' saying that httpd.conf is loaded. But are you using httpd.conf or .htaccess?

User avatar
Posts: 9
Joined: 12 Feb 2013, 10:01

Re: RewriteCond QUERY_STRING not working on server

01 Aug 2013, 11:11

I have been editing the http.conf file. Our servers our windows with IIS. Many thanks.

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

Re: RewriteCond QUERY_STRING not working on server

01 Aug 2013, 14:41

Yes, try to upgrade to the latest build, which is 102.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 17 guests