3 ms·
The common redirects that most webservers do are: /path to /path/ *if and only if /path is a directory in the filesystem* /path/ to /path/index.htm[l] (usual
by harshreality 5y ago
The common redirects that most webservers do are:
/path to /path/ *if and only if /path is a directory in the filesystem*
/path/ to /path/index.htm[l] (usually the default of some indexing module, often configurable so you or some other module can add index.php etc.)
Redirects can be internal or external. Nginx, for instance, does step 1 via an external redirect and step 2 via an internal redirect, so the final url displayed in the browser when the input was /path would end up as /path/ but not /path/index.html even if that's what's being served. You can, however, combine both steps into one and make it an internal redirect by doing something like "try_files $uri/index.html ..."
It's not standard to rewrite:
/path to /path.html
But almost any webserver can be configured to do so, and various websites and web apps may have reasons for doing that. Then it's merely a matter of understanding the webserver's internal configuration rule order to determine whether it'll redirect /path preferentially to /path/index.html or to /path.html
There's no universal right or wrong. Every one of those paths is different, and webservers can choose which to rewrite to which other.