Why does a URL with two hyphens (in the same segment) correspond to a Route in my route table?

I am trying to resolve this url.

Route articlesByCategory = new Route("articles/c{cid}-{category}", new Handler);

However, it seems that the following URL will not allow this route:

// doesn't work
www.site.com/articles/c24-this-is-the-category-title

// This works
www.site.com/articles/c24-category

I suppose this is due to a dash in the title, but can anyone tell me why this works this way?

Is there a way to allow dashes in the header for a URL route like this?

+3
source share
1 answer

What hyphen is a delimiter?

, URL- cid category. . , - , . , .

fooobar.com/questions/737835/... , ...

+1

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


All Articles