0

I am currently using one host to host multiple domains (each domain is pointed to a folder in the root directory). Which generally works fine, but the problem comes when trying to access sub-directories of a domain.

So for example, I have the domain example.com which is pointed this way

example.com points to \folder\abc\

https://example.com works fine
https://example.com/xyz/ works fine, where xyz is a sub-directory in the abc folder.
https://example.com/xyz redirects to https://example.com/folder/abc/xyz/

Is there something I need to do in my .htaccess file or web.config to fix this issue where URLs without trailing slash point in a different way?

--
Update:
This is what my .htaccess rules look like:

RewriteCond %{HTTP_HOST} example\.com$
RewriteOptions AllowNoSlash
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_URI} (.*)
RewriteCond %{REQUEST_URI} !/$ 
RewriteRule (.+[^/])$ %1/ [R=301,L]

0 Answers0