Why do many Ruby on Rails applications lack trailing slashes?

Why do so many Ruby on Rails applications have no codes in their URLs? One example is http://basecamphq.com/tour . AFAIK this is contrary to Internet standards. Is this related to how RoR is configured?

+3
source share
7 answers

This is not against web standards. http://basecamphq.com/tour is considered a file. http://basecamphq.com/tour/ will be a directory (Note: both URLs are not equal, although some web servers, such as Apache, will check the other if it does not exist ) Since both types are virtual, it mainly depends on the developer (it does not depend on the programming languages ​​or frameworks used).

I don’t think this has anything to do with caching (as nilamo mentioned), because HTTP headers are enough to control the cache - maybe some reverse proxies have different default behavior.

+12
source

Your argument is invalid:

w3c url URL-.

, :

. , "/" (ASCII 2F hex) , .

.

- !

+5

, Rails, . tour.html , , .html , .

+2

, , RoR URL-, , , route.rb, , t .

+1

, - . .

0

Rails ,

/post/:year/:page

/post/2012/a-title, /post/2012/a-title/, . -.

, . < img src= " image.png" / > : /post/2012/image.png ( ) /post/2012/a-title/image.png ( ), , .

Rails , URL- ! URL-, ... , .

0

This is a URL rewrite form. This is not against the web standard and actually does a lot for usability and has been proven to help your search engine ranking. Think of it this way.

You tell your friend about this cool post you saw on someone's blog. Which URL is easier to tell a friend:

OR

  1. http://www.coolwebsite.com/cool-ideas-for-posts/
-3
source

Source: https://habr.com/ru/post/1720884/


All Articles