htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: simple redirect I'm not able to get working, please help
PostPosted: 05 Jul 2008 22:15 
Offline

Joined: 05 Jul 2008 21:45
Posts: 2
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:
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 .


Top
 Profile  
 
 Post subject: Re: simple redirect I'm not able to get working, please help
PostPosted: 08 Jul 2008 22:03 
Offline

Joined: 05 Jul 2008 21:45
Posts: 2
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
Quote:
RewriteCond %{QUERY_STRING} =topic=31
RewriteRule ^$ http://www.myurl/forumdirectory/?topic=31.0 [R=301,L]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB