This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: short url redirects with query string
Author
Message |
guamgirl
Groupie


Joined: 13 April 2010
Posts: 57
Posted: 10 November 2011 at 9:42am

Hi.  The following used to work before and it doesn't now.  Can you please verify that my redirects are correct?

RewriteCond %{Query_String} ^id=5462$
RewriteRule ^/revolution.aspx$ http://www.multiclient.westerngeco.com/Default.cfm? [NC,R=301,L]

RewriteCond %{Query_String} ^id=5463$
RewriteRule ^/revolution2.aspx$ http://www.multiclient.westerngeco.com/Default.cfm? [NC,R=301,L]

RewriteCond %{Query_String} ^id=5602$
RewriteRule ^/revolution3.aspx$ http://www.multiclient.westerngeco.com/Default.cfm? [NC,R=301,L]

 

These are short urls that should redirect when we go from

http://www.westerngeco.com/revolution

http://www.westerngeco.com/revolution2

http://www.westerngeco.com/revolution3

 



Edited by guamgirl - 10 November 2011 at 9:43am
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 10 November 2011 at 11:12am

You don't mention .aspx extension when you showed how short URLs should look like. So maybe the rules should be:

RewriteCond %{QUERY_STRING} ^id=5462$
RewriteRule ^/revolution$ http://www.multiclient.westerngeco.com/Default.cfm? [NC,R=301,L]

RewriteCond %{QUERY_STRING} ^id=5463$
RewriteRule ^/revolution2$ http://www.multiclient.westerngeco.com/Default.cfm? [NC,R=301,L]

RewriteCond %{QUERY_STRING} ^id=5602$
RewriteRule ^/revolution3$ http://www.multiclient.westerngeco.com/Default.cfm? [NC,R=301,L]

__________________
Regards,
Anton
Back to Top
 
guamgirl
Groupie


Joined: 13 April 2010
Posts: 57
Posted: 10 November 2011 at 1:27pm

sorry, it's implicit. it should have the .aspx extension. 
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 11 November 2011 at 2:33am

If the rules are in .htaccess, this might work:

RewriteBase /
RewriteCond %{QUERY_STRING} ^id=5462$
RewriteRule ^revolution\.aspx$ http://www.multiclient.westerngeco.com/Default.cfm? [NC,R=301,L]

RewriteCond %{QUERY_STRING} ^id=5463$
RewriteRule ^revolution2\.aspx$ http://www.multiclient.westerngeco.com/Default.cfm? [NC,R=301,L]

RewriteCond %{QUERY_STRING} ^id=5602$
RewriteRule ^revolution3\.aspx$ http://www.multiclient.westerngeco.com/Default.cfm? [NC,R=301,L]

BTW, is it ok that all 3 rules point to the same destination?

If it doesn't work, please enable logging in httpd.conf by putting

RewriteLogLevel 9

and then make the request once again and show me the logs.

__________________
Regards,
Anton
Back to Top
 
guamgirl
Groupie


Joined: 13 April 2010
Posts: 57
Posted: 11 November 2011 at 7:25am

Thanks, Anton. It didn't work.  I've emailed the Rewrite.log.

As for your question, here's what is supposed to happen:

www.westerngeco.com/revolution.aspx should redirect to http://www.multiclient.westerngeco.com/Default.cfm?id=5462

www.westerngeco.com/revolution2.aspx should redirect to http://www.multiclient.westerngeco.com/Default.cfm?id=5463

www.westerngeco.com/revolution3.aspx should redirect to http://www.multiclient.westerngeco.com/Default.cfm?id=5602

Maybe I should point out that we've just recently upgraded to Sitecore 6.4.  Our IIS mode is still set to Classic.  We noticed that our other redirects weren't working at first and then they started working again except for the ones with the query strings that have name-value pair.



Edited by guamgirl - 11 November 2011 at 7:37am
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 14 November 2011 at 4:37am

If this is really what you want to happen:

www.westerngeco.com/revolution.aspx should redirect to http://www.multiclient.westerngeco.com/Default.cfm?id=5462
www.westerngeco.com/revolution2.aspx should redirect to http://www.multiclient.westerngeco.com/Default.cfm?id=5463
www.westerngeco.com/revolution3.aspx should redirect to http://www.multiclient.westerngeco.com/Default.cfm?id=5602

then config should be fixed like this:

RewriteBase /
RewriteRule ^revolution\.aspx$ http://www.multiclient.westerngeco.com/Default.cfm?id=5462 [NC,R=301,L]

RewriteRule ^revolution2\.aspx$ http://www.multiclient.westerngeco.com/Default.cfm?id=5463 [NC,R=301,L]

RewriteRule ^revolution3\.aspx$ http://www.multiclient.westerngeco.com/Default.cfm?id=5602 [NC,R=301,L]

And as for the logs you sent us, I couldn't see a single request to /revolution... there...

__________________
Regards,
Anton
Back to Top
 
guamgirl
Groupie


Joined: 13 April 2010
Posts: 57
Posted: 14 November 2011 at 9:38am

Thanks, Anton.  That worked.
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version