Answer the question
In order to leave comments, you need to log in
How to shorten URL using .htaccess?
Actually the question has already been asked. In more detail, I need to be able to store the file on the server in the form:
/folder/name1/index.php And it was available
at
site.ru/name1/index.php
everything inside it that would be available at a shortened URL. I hope I have explained the problem clearly.
There can also be several folders inside /folder, for example:
/folder/name1/index.php
/folder/name2/index.php
/folder/name3/index.php
And, accordingly, so that everything is available at
site.ru/name1
site.ru/name2
site.ru/name3
_ I do not understand them, but to show with an example.
Answer the question
In order to leave comments, you need to log in
seems to have solved the problem!
RewriteCond %{DOCUMENT_ROOT}/folder/$1/index.php -f
RewriteRule ^(.*)$ folder/$1/index.php [L,QSA]
If suddenly someone needs it!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question