Answer the question
In order to leave comments, you need to log in
CNC rewrite nesting: how?
Good afternoon!
There are urls like:
site.ru/catalog/razdel/1.php
site.ru/catalog/folder/2.php
site.ru/folder/papka/3.php
How to convert to a link like:
site.ru/2.php
site.ru/1.php
The sections are different, how can I do it without a database? But at the same time, you need to know which directory the page belongs to.
Answer the question
In order to leave comments, you need to log in
.htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php
$requestedString = explode('?', getenv('REQUEST_URI'));
$requestedString = $requestedString[0];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question