The site consists of only one page index.php. The structure of the site is contained in the database and should be presented to the user in a hierarchical form:
имя_сайта\каталог1\каталог2\....\каталогN
The number of directories and the number of levels of investment is unlimited. The user can delete a part of the address to the i-th directory in the browser line and get information on this directory.
I implemented this problem statement using .htaccess
RewriteEngine on RewriteRule ^([a-zA-Z0-9_/]+)/([a-zA-Z0-9_]+)$ index.php?catalog_name=$2 [L]
That is, I use the GET method as the catalog_name
parameter to name the last directory, look for it in the database and enter information from the database on it.
The problem is that when the user types in the address bar of the browser
имя_сайта\каталог1\каталог2\....\каталогN
After the server executes the RewriteRule
command
The address bar in the browser for the user changes to index.php?catalog_name=каталогN
(although it remains the same in some servers), which is inconvenient for the user.
I would like to address
имя_сайта\каталог1\каталог2\....\каталогN
In the browser line for the user after the execution of the RewriteRule
did not change and the user did not know that there is
index.php?catalog_name=каталогN