I am trying to understand why all requests to a subfolder always perform a 302 redirect, appending a trailing slash.
Subdirectory WITHOUT trailing slash
dev.example.com/test redirects to dev.example.com/test/
When I navigate to the domain itself, it does not append a trailing slash:
Root Domain WITHOUT trailing slash
dev.example.com does NOT redirect to dev.example.com/
Instead the trailing slash is REMOVED when navigating to the domain with the trailing slash appended:
Root Domain WITH trailing slash
dev.example.com/ redirects to dev.example.com
When I observe the headers I see the following:
HTTP/1.1 302 Object moved Server: Microsoft-IIS/6.0
My resource is located within my hosting account at the following path from the root:
My main questions are as follows:
1) Could someone explain the ISAPI Rewrite rule above in simple terms?
2) Is the above ISAPI rule responsible for appending/removing the trailing slash as outlined above?
3) I have hosted in multiple environments, but the above behaviour appears isolated to the server environment I am currently hosted on. Is there any way I can prevent the trailing slash from being appended?
Please note the purpose is to ensure no redirects occur when I request a resource that does not end in a trailing slash for SEO.