html - Relative URLs and trailing slashes -


I have looked around the web for this first, and I doubt that "you can not do", but Later, I have not received any reply which is definite, I think it is worth asking here. The closest I've touched this problem (which is currently down but Google is).

With an indexed slash, the traditional design of the URL is being interpreted as a directory and without any trailing slash interpreted as a file resource, and the related URL If working in the current page,

  / lorem / ipsum / dolor   P>  
  non-roller < A relative path of / code>  

  / lorem / ipsum / not-  

which naturally can be understood When / lorem / ipsum / dolor is viewed as a file resource, dolor , directory, / lorem / ipsum / ; Typical, intuitive conventions However, since a large number of websites are now dynamic applications without the filesystem mapping for each URL, this can cause headache, because sometimes you really want to work relative to the path, though In the present design, there were a trailing slash

Is there any reasonable way to use relative path related to the current route ("server-side p Rosesing / environmental / other, or does not contain JavaScript "), and not " directory of the current path "? That is why the output can be relative to no-dolor / lorem / ipsum / dolor and

  / lorem / ipsum / dolor / not -   

From to

(/ lorem /) ipsum / . Redirect to the following slash and to ensure that the URLs in all the resources that correspond to the directory-eye and file-iish nature, or modify the device (!), What is any way to deal with this?

No

The problem is not very much related to the director / file mapping (which is never how is expected as a mapping, only convenient mapping is allowed, which is still convenient).

It is more related to the general fact that dolor is not equal to dolor / and you have a reference related to dolor / Want to give a new URI, when a code ends in dolor

What can be the solution, it is always to work with / lorem / ipsum / dolor / to say so, whenever / lorem / ipsum / Dolor is never talking about, only after / lorem / ipsum / dolor / , after the directory / file mapping, as you say Are not the only way to work, there is no reason that your resource name should not always be in the slash.

In fact, it matters anyway, as you are saying using such relative links that / lorem / ipsum / dolor / not-dolor There is no connection between and / lorem / ipsum / dolor . Now, while / lorem / ipsum / dolor / not-dolor can not be related to more than / lorem / ipsum / dolor / , it can mean that In URI (yes, URIs are opaque, but whenever they should be considered opaque at certain levels, they are allowed to reflect the relationship, and this is the reason that relative URI references are meant) . Therefore, / lorem / ipsum / dolor / more clearly reflects your overall URI-to-resource mapping (if it does not happen, then you can not go any way from the player ).

Now, it comes down to redirect to a trailing slash, which you say you (or better yet, do not call dolor to the first place in the first place) ), But its advantages are now better than the convenience of easy relative URI.

Comments