We have been instructed to use a folder type system for a number of sites (as contexts in one MODX install). For example:
Main Site:
http://www.whatever.com
Related Site:
http://www.whatever.com/ca/fr (French Canadian Version)
Related Site:
http://www.whatever.com/newyork/grimrock (A related site in the New York Region)
We are using
XRouting (Github
here) for the context routing so for the sub sites we would use the following settings:
French Canadian Site
http_host: whatever.com
base_url: /ca/fr/
New York Site
http_host: whatever.com
base_url: /newyork/grimrock/
The issue is if a user visits:
http://www.whatever.com/newyork/grimrock
We get a 503 Error.
If a user visits:
http://www.whatever.com/newyork/grimrock/
Note, with the trailing slash. It resolves successfully.
If we change the base_url to: /newyork/grimrock
Note, without the trailing slash. Then this:
http://www.whatever.com/newyork/grimrock
Resolves successfully, but then any other pages do not, such as:
http://www.whatever.com/newyork/grimrock/about.html
Yet when we restore the base_url to: /newyork/grimrock/ and go click the About link, even though the URL is exactly the same (i.e.
http://www.whatever.com/newyork/grimrock/about.html) it resolves successfully.
So the challenge we have is how do we automatically add the trailing slash to just the home page URL?