A
A
Andrey Kotosin2018-04-23 20:12:13
Apache HTTP Server
Andrey Kotosin, 2018-04-23 20:12:13

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

2 answer(s)
A
Andrey Kotosin, 2018-04-23
@av_kotosin

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!

D
Dmitry, 2018-04-23
@demon416nds

mod rewrite to help
and read the articles until it becomes clear
, it’s not always on other people’s advice to leave

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question