Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force URL trailing slash when loading CMS UI #332

Closed
erquhart opened this issue Mar 30, 2017 · 7 comments
Closed

Force URL trailing slash when loading CMS UI #332

erquhart opened this issue Mar 30, 2017 · 7 comments

Comments

@erquhart
Copy link
Contributor

erquhart commented Mar 30, 2017

If the CMS is provided through a file at example.com/admin/index.html, and a user loads it via example.com/admin, the location ends up at example.com/admin#/, and relative paths are relative to root instead of /admin/. This stops the config file from loading, among other things.

React Router may have a config to help with this, but we'll probably just need to force a trailing slash before loading the app.

@domachine
Copy link

What about recommending a <base href='/admin/'> in the index.html that loads the admin UI?

@erquhart
Copy link
Contributor Author

erquhart commented Apr 4, 2017

That could help, but it isn't always appropriate, and may actually add confusion for some users. Still feels like we're better off adding the trailing slash and resolving this automatically for all users. We'd probably need to add a config option as well to turn off for odd use cases, but that should be a pretty rare need.

@josephearl
Copy link
Contributor

Related - if you type in the URL with a double // you get a Uncaught DOMException: Failed to execute 'replace' on 'Location': '//#/' is not a valid URL.

@tech4him1
Copy link
Contributor

Does this actually break anything except loading the config.yml? If not, couldn't we just search both paths (${ currentPath }/config.yml and ${ currentPath }config.yml)?

@jacklorusso
Copy link

React Router's Redirect could be used to redirect admin to admin/? If you think this is a decent approach I would be happy to work on it

@erquhart
Copy link
Contributor Author

@lol-russo my concern on this has been that the CMS has no control over it's environment, so I'd hate to cause regressions by enforcing this. The number one issue behind this symptom is a site generator unexpectedly producing both admin.html and admin/index.html, typically Hugo. I think a better fix might to be to start documenting the issues for each static site generator that has them. We could (and should) have a dedicated page in our docs for individual generators anyway.

Thoughts?

@erquhart
Copy link
Contributor Author

erquhart commented Dec 9, 2017

Pretty sure this isn't something the cms should handle, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants