I'm trying to reduce the number of redirects and number of duplicate content pages and somehow I think that the first occurrence of /? in a URL actually means /firstfoundscript? where "firstfoundscript" could be index.php or index.html or anything like that.

I also think if someone were to access:


That it would actually mean:


Am I correct with this thinking?


Yes you are correct though it is not because of the combination of /?.

Before going into further detail it is worth noting that for it to be a valid URL there should be a maximum of one question mark (?) since this is a special character signifying the start of the query string. If you wish to have a question mark within your query string data then it must be URL-encoded, e.g. %3F.

The part of the URL starting with a question mark (?) is called the query string and essentially is a sequence of parameters in the format ?param1=value1&param2=value2&param3=value3, where the value in each case follows the equals symbol (=), and each parameter value pair is separated by an ampersand ('&').

To help identify the script which will be accessed, first remove this component of the URL, and in your case this leaves you with http://example.com/a/b/. Whenever a folder path is specified but has no filename on the end, the webserver selects from a list of configured default files, e.g. index.html, index.php, index.asp.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.