RewriteCond QUERY_STRING not working on server
8 posts
• Page 1 of 1
RewriteCond QUERY_STRING not working on server
**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:
The following rule however, works fine both locally and on live:
Many thanks for any advice.
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.
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: RewriteCond QUERY_STRING not working on server
Hello,
There's only one problem I can see with the rule. The Host condition should look:
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
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
Re: RewriteCond QUERY_STRING not working on server
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?
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: RewriteCond QUERY_STRING not working on server
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
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
Re: RewriteCond QUERY_STRING not working on server
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.
[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.
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: RewriteCond QUERY_STRING not working on server
Sorry, youre' saying that httpd.conf is loaded. But are you using httpd.conf or .htaccess?
Re: RewriteCond QUERY_STRING not working on server
I have been editing the http.conf file. Our servers our windows with IIS. Many thanks.
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: RewriteCond QUERY_STRING not working on server
Yes, try to upgrade to the latest build, which is 102.
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 17 guests