R
R
Roman Rakzin2020-05-07 15:03:22
htaccess
Roman Rakzin, 2020-05-07 15:03:22

How to redirect to a folder in htaccess?

I need to add a redirect, if the user visits the link
mysite/admin-control/ , then requests are redirected to the MyFiles folder "as is" with subfolders and all files. That is, if the user follows the link mysite/admin-control/pictures/my.jpg , then what would the subfolders and files be visible. How to do this?
Here is my code redirects everything to one folder, that is, if I enter mysite.com/admin-control/pictures/my.jpg - I get to mysite.com/admin-control/index.php so with any link

RewriteCond %{REQUEST_URI} ^/admin-control/ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ admin/src/ [QSA,L]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2020-05-07
@shambler81

RewriteCond %{REQUEST_URI} ^admin-control/.* [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.* admin/src/ [QSA,L]

But in general, describe why you are doing this, perhaps there is already a solution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question