O
O
olegolegooov2019-05-26 23:37:00
htaccess
olegolegooov, 2019-05-26 23:37:00

How to remove .php from nested pages?

Tell me how to remove .php from nested pages
. For pages that are nested relative to the main one (site.ru/stranica1), it was possible to remove it, everything works fine
. But for some reason, pages that are nested in folders are not removed (site.ru/catalog/ coca-cola.php)
Is it possible to somehow remove the extension at the end of such pages?
And the second point, there is a site.ru/catalog/mail.php system file that processes and sends requests from the site, and you cannot remove the .php extension from it, otherwise it will not work.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Danil Sapegin, 2019-05-27
@ynblpb_spb

People do not remove extensions, but change the architecture of the application.
In short, the web server is configured in such a way that a request to any URL of your site is processed by one file (index.php) inside this file to determine which URL and display the desired page.
Google for php router for details

A
AUser0, 2019-05-27
@AUser0

>> But for some reason, pages that are nested in folders are not removed (site.ru/catalog/coca-cola.php)
Because in the .htaccess rule that you did not provide, nothing is written about the subdirectory in the path to final .php file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question