A
A
Andrey2017-05-27 18:35:37
htaccess
Andrey, 2017-05-27 18:35:37

How to shorten links in htaccess?

Good afternoon!
There are links like:
http://site.ru/main/{folder that can change}/folder/{file names of which are many}.php
How to do it:
http://site.ru/{file names of which are many}.php
or
http://site.ru/pages/{there are a lot of file names}.php
Tried a lot of options already.... so far nothing has helped((
--------
UPD
Finally got to do what would be the name file changed, but how to make the folder change - I can’t catch up (

RewriteRule ^([a-zA-Z0-9_-]+).php$ design/FOLDER/html/$1.php [L]

Can I set some variable or something? (FOLDER is a folder with site files (index.php, about.php, etc.))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
likenoother, 2017-05-28
@likenoother

What have you tried?
Something like this:
RedirectMatch ^/main/.*/folder/(.*\.php)$ www.site.ru/pages/$1
?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question