Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Dangerous - php query string parameters

         

serenoo

10:46 pm on Jan 13, 2011 (gmt 0)

10+ Year Member



I noticed that if you own a php website with directories and index.php
(I mean www.example.com/dir1/) and someone link to you as
www.example.com/dir1/?AB
then google grab 2 pages and you lose power on /dir1/.
This could be a way to damage your enemies too (it is enough you link the same page of your competitor with many parameters)

Is there a way to avoid such danger?

brotherhood of LAN

10:54 pm on Jan 13, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can tell the major engines what the 'preferred' URL for a page is using the canonical element [googlewebmastercentral.blogspot.com], to avoid duplicate content and issues such as this. Webmasterworld discussed the canonical element [webmasterworld.com] upon its release.

.htaccess is another option, as is using server side scriping to dictate what should return a 200 response, what should be indexed by search engines etc.

g1smd

1:01 am on Jan 14, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Another alternative is to redirect incoming requests for incorrect URLs to the correct URL if you want the link, and to fail with a 404 links that you do not want - i.e. links from spam sites etc.