query string
7 posts
• Page 1 of 1
query string
Hi, I'm trying to redirect a query string from http://framoeng.no/?page=136&show=254.aspx to http://www.slb.com/services/subsea/subs ... tcher.aspx. The redirect that I created isn't working:
RewriteCond %{Query_String} ^page=136&show=254$
RewriteRule ^/$ http://www.slb.com/services/subsea/subs ... tcher.aspx? [NC,R=301,L]
What am I doing wrong?
Regards,
Emy
RewriteCond %{Query_String} ^page=136&show=254$
RewriteRule ^/$ http://www.slb.com/services/subsea/subs ... tcher.aspx? [NC,R=301,L]
What am I doing wrong?
Regards,
Emy
Re: query string
Please try to use the following config:
RewriteBase /
RewriteCond %{QUERY_STRING} ^page=136&show=254$ [NC]
RewriteRule ^/?$ http://www.slb.com/services/subsea/subs ... tcher.aspx? [NC,R=301,L]
RewriteBase /
RewriteCond %{QUERY_STRING} ^page=136&show=254$ [NC]
RewriteRule ^/?$ http://www.slb.com/services/subsea/subs ... tcher.aspx? [NC,R=301,L]
Re: query string
Hello, Emy
Please enable logging in httpd.conf by putting the following lines:
RewriteLogLevel 9
LogLevel debug
And then provide error.log and rewrite.log records for your request
(http://framoeng.no/?page=136&show=254.aspx).
Please enable logging in httpd.conf by putting the following lines:
RewriteLogLevel 9
LogLevel debug
And then provide error.log and rewrite.log records for your request
(http://framoeng.no/?page=136&show=254.aspx).
Re: query string
Hi, Anton.
I've enabled the logging, but I didn't see anything related to http://framoeng.no/?page=136&show=254.aspx.
Regards,
Emy
I've enabled the logging, but I didn't see anything related to http://framoeng.no/?page=136&show=254.aspx.
Regards,
Emy
Re: query string
Hello, Emy
Would you please provide rewrite.log and error.log records anyway, they might still be helpful.
Also, please check the IIS log - what status is shown for the target request?
And please make sure any rules are working in the config, e.g. put the following rule on top of your config
RewriteRule testtest http://www.google.com [NC,R=301,L]
And then request www.yoursite.com/testtest. Report the result (Google page would mean it's working, while 404 will indicate some problem).
Would you please provide rewrite.log and error.log records anyway, they might still be helpful.
Also, please check the IIS log - what status is shown for the target request?
And please make sure any rules are working in the config, e.g. put the following rule on top of your config
RewriteRule testtest http://www.google.com [NC,R=301,L]
And then request www.yoursite.com/testtest. Report the result (Google page would mean it's working, while 404 will indicate some problem).
Re: query string
Anton figured out the reason why it wasn't working.
I needed to add the following condition to the domain redirect:
RewriteCond %{QUERY_STRING} ^$
The condition checks if there's a query string in the request to the root. If it's there, the redirect to services/subsea.aspx shouldn't fire and is overridden.
I needed to add the following condition to the domain redirect:
RewriteCond %{QUERY_STRING} ^$
The condition checks if there's a query string in the request to the root. If it's there, the redirect to services/subsea.aspx shouldn't fire and is overridden.
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 28 guests