Welcome to WebmasterWorld Guest from 188.8.131.52
Forum Moderators: mack
But some engines like Google are clever enough to check the URLs to see if they're unique enough to warrant being called a unique page.
It doesn't matter for the root of the domain, i.e. domain.com and domain.com/ though it's good practice to use the latter.
The issue is quite similar to www.domain.com and domain.com. It can be easy to assume that they also point to the same page though it's not always necessarily true.
Depending on how important the non-/ link is to you, perhaps you can just 404 it instead? If you do that then in future people won't mistakenly link to the wrong URL.
[edited by: brotherhood_of_LAN at 1:16 pm (utc) on Oct. 5, 2008]
Since the site is dynamic and uses clean URL rewrites, I would expect there not be any excess burden on the server, since the request is rewritten to a compliant messy URL before actual processing.
The usual approach to implementing extensionless URLs is to use mod_rewrite to detect URL-paths having no extension (e.g. having no period in the final URL-path-part), append ".html" or ".php" to those URLs, and then do a check for "file exists" with that appended extension. If the extensionless URL plus appended filetype exists as a file, then internally rewrite to that file. Otherwise, leave the request alone and let mod_dir try to resolve it as a directory.
It is also possible, though not very efficient, to work through a "priority list" of possible extensions: For example, to try .php, .html, and .htm extensions in order, and rewrite to the first one that exists.
To solve the appended-slash-on-page-URL problem, you can use an external 301 redirect based on opposite and somewhat extended logic: If the slashed URL does not exist as a directory, but does exists as a file when the slash is removed and an extension added, then externally redirect to remove the slash, and let the code described above do the rest. Alternatively, you can let let "pages" take precedence over directories if/when a naming collision occurs by simply omitting the directory-exists check.
For more information, see the RewriteCond directive and its "-f" and "-d" tokens in the Apache mod_rewrite documentation.