Forum Moderators: phranque

Message Too Old, No Replies

Remove extra parameters

         

hanyaz

2:41 pm on Jan 5, 2011 (gmt 0)

10+ Year Member



Hi everyone and happy new year.
I am trying to remove some extra useless parameters from my URLs because in google webmaster tools, they are spotted as duplicate content .
Here is an exemple of what i see :

/subf/Page-15.html
/subf/Page-15.html?change_font=large


I would like to remove the change_font parameter. I have tried the following in my hthaccess :


RewriteCond %{query_string} ^.+
RewriteRule ^(.*)$ http://www.mysite.com/$1? [R=301,L]


However this remove some other parameters necessary for the site, so i tried the following :


RewriteCond %{query_string} ^.change_font
RewriteRule ^(.*)$ http://www.mysite.com/$1? [R=301,L]



I does not redirect....
Would be greateful for any suggestion
Regards

jdMorgan

10:32 pm on Jan 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The most important thing is to fix whatever problem is *creating* these URLs with extra query parameters. Redirecting Googlebot before fixing that problem may be taken as a sign of "poor site administration quality." While this will not trigger a ranking penalty, it certainly won't be helpful...

However, if these query strings are NOT added by scripts on your own site, and are only present in external links to your site, then that's not a worry. Google will take into account the domain on which the links are found, and you're not responsible for other sites (mainly because G knows that this could be "malicious linking" by a competitor, or simple incompetence on the part of another Webmaster).

The main problem in your code is that your RewriteCond pattern matches only queries starting with any single character followed by "change_font", followed by anything or nothing. Change the RewriteCond to
RewriteCond %{QUERY_STRING} ^change_font= 

and it should work.

(Note that it is unwise to take any liberties whatsoever with the syntax given in the mod_rewrite documentation. This extends to capitalization and even spacing. Most of the time it does not matter. But sometimes it does.)

Jim

hanyaz

1:51 pm on Jan 6, 2011 (gmt 0)

10+ Year Member



hello,
I am using some joomla template that i have bought a while ago....it is producing these urls and i am trying to fix it. I also noticed that people coming from facebook generate some urls like :
sms_ss=facebook&at_xt=#*$!X

I found i good article giving me further reasons to do so

[briancray.com...]


Thanks very much admin that solved my issue.
Han