Forum Moderators: phranque
for example
www.example.com/?test.htm brings up www.example.com/ but with ?test.htm at the end. Seems an easy way to get into duplicate penalty territory if someone decides to link to the page that way, maliciously or not.
Why doesnt this result in a 404? and whats the best was to rectify this?
Give you an example: script "test.cgi" (pseudo code, leaving out the part that reads and parses the query string:)
URL 1: http://example.com/test.cgi
URL 2: http://example.com/test.cgi?v=Hello+World
#!/usr/bin/perl
## "parse_query_string" stores variables in key-value pairs in "%invar"
%invar = &parse_query_string;
print "content-type:text/html\n\n";
if (defined($invar{'v'})) { print "$invar{'v'}"; }
else { print "No variable sent"; }
URL 1 will print "No variable sent" and URL 2 will print "Hello World."
Both are the same url, one has a query string, one doesn't.
When you sent this syntax to a static page, the URL is the same.