A
A
alestro2015-10-03 21:32:12
PHP
alestro, 2015-10-03 21:32:12

How are cnc's implemented?

I have a url like: domain.loc/categories/all/ and domain.loc/categories/all/digital/tv (you need to shorten it to /categories/digital/tv)
Where category is the name of the controller, and all is the name of the action, respectively, everything would be seems good, but the NC is organized in such a way that the number of parameters must be a multiple of two, otherwise it throws an exception. I would like to know how
the NC type domain.loc/categories/ is implemented with a single entry point - index.php and whether it is possible at all. And which way to dig

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
OnYourLips, 2015-10-03
@OnYourLips

I will assume that you have nginx (Apache would look strange on a developer's computer in 2015).
At the very bottom of the Laravel documentation ( https://laravel.ru/docs/v5/configuration) it says:

In Nginx, the following directive in your site settings allows "pretty" URLs to be used:
PHP
location / {
  try_files $uri $uri/ /index.php?$query_string;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question