simple redirect I'm not able to get working, please help

Ask your mod_rewrite and Redirection questions here, and get answers!

simple redirect I'm not able to get working, please help

Postby gio3 » 05 Jul 2008 22:15

Hi to all, I'm new here and quite a newbie with .htaccess issues.
I have got dinamic page indexed by Google with two different urls like
/?topic=177 and /?topic=177.0
It was my fault cause a bad link in a thread.
Now I need to redirect the first url to the second one, that is the standard for the script, and I just tried a simple redirect added at the end of my .htaccess, just redirecting notwww to www et index.php to root.
Code: Select all
redirect 301 /?topic=177 http://www.leoccare.com/forum/?topic=177.0

It doesn't work at all, the url isn't redirected.
Can you please help me?
I have other redirect like this on static pages that works perfectly, I suppose the problem is in the special characters ? = and .
gio3
 
Posts: 2
Joined: 05 Jul 2008 21:45

Re: simple redirect I'm not able to get working, please help

Postby gio3 » 08 Jul 2008 22:03

Not a lot of help here!
BTW I solved my problem after a lot of work and research.
I just post here the solution for future reference, just in the case someone else my need that.
Only RewriteCond can read a query string and I have to use it
I have to use the ConditionPattern = to avoid an infinite loop (to avoid to rewrite 31.0)
This is the working code
RewriteCond %{QUERY_STRING} =topic=31
RewriteRule ^$ http://www.myurl/forumdirectory/?topic=31.0 [R=301,L]
gio3
 
Posts: 2
Joined: 05 Jul 2008 21:45


Return to Redirect or Rewrite Questions



Who is online

Users browsing this forum: clerkfurniture, HIBcokyacrornsap, LOTVodaPeece, ShakhtarrDon, VocrepeAcceby, Zitioutbava