You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a subdirectory of public called cartography. Whenever I access the URL http://localhost/cartography/, everything works fine. However, when I access the URL http://localhost/cartography (without trailing slash) all of my relative URLs on the page become 404s because instead of looking for http://localhost/cartography/style.css, it serves http://localhost/style.css.
I admit to being spoiled by web servers like Apache/nginx, and I understand hapi may not necessarily be a replacement for Apache. I just happen to like hapi a lot.
My question is, what is the preferred way to handle this situation with the trailing slash? Is there a way to redirect users from the non-slash to the slash? Do I just not use relative URLs?
Thanks.
The text was updated successfully, but these errors were encountered:
@hueniverse I first noticed this when sharing the link as http://myhostname/cartography/ on Google Hangouts (with the slash), and the 'linkified' link did not glob the trailing slash. It does as well happen when the user types in the URL manually without the trailing slash. When the user uses the links from the http://myhostname/ page, everything behaves fine because I have control over that.
I understand that it is not the responsibility of the hapi team to be concerned with user error of incorrect typing or Google's very odd link globbing procedure. I'm bringing this up with hopes of finding a workaround or a suggested method so I can close up a potential hole in user experience of my application.
I am using a route like follows, in order to serve static content in the
public
directory:There is a subdirectory of
public
calledcartography
. Whenever I access the URLhttp://localhost/cartography/
, everything works fine. However, when I access the URLhttp://localhost/cartography
(without trailing slash) all of my relative URLs on the page become 404s because instead of looking forhttp://localhost/cartography/style.css
, it serveshttp://localhost/style.css
.I admit to being spoiled by web servers like Apache/nginx, and I understand hapi may not necessarily be a replacement for Apache. I just happen to like hapi a lot.
My question is, what is the preferred way to handle this situation with the trailing slash? Is there a way to redirect users from the non-slash to the slash? Do I just not use relative URLs?
Thanks.
The text was updated successfully, but these errors were encountered: