: Would having a './' in a URL cause any trouble with search engines? For code simplicity, some of my URLs in my website might contain a ./ For example: www.example.com/./something The ./
For code simplicity, some of my URLs in my website might contain a ./
For example:
example.com/./something
The ./ is automatically stripped-out by the browser, and the resulting URL is:
example.com/something
My question is: could such URLs cause any trouble? Will search engines be able to correctly resolve these URLs?
More posts by @Smith883
2 Comments
Sorted by latest first Latest Oldest Best
No they will not cause any issues (nor do you need to do any kind of redirect). RFC 3986 (the official URI spec) specifies a "Reference Resolution" section which states any path segments (between slashes) containing only dots should be removed. Single dots are removed entirely while double dots essentially remove the previous directory from the URL.
Also note that no file system in popular use (Windows/Mac/Linux) allows a filename composed of just dots so a URL containing /./ doesn't really make sense.
In short, when any user agent (browser or search engine) sees a URL containing a single dot it won't ever request that URL, it will request the "proper" one.
Ideally you will have a rewrite rule that will strip it out by doing a permanent redirect (301). That way, These URLs will never be resolved, only the correct one.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.