S
S
sstars2018-02-02 16:41:51
Apache HTTP Server
sstars, 2018-02-02 16:41:51

How to create correct PHP APACHE redirect?

How to make it so that upon request url - site.ru/name_folder/ content is loaded from the site.ru/myfolders/name_folder/ folder, where name_folder names are the same!?
You also need to exclude the site.ru/js, site.ru/css folders. And at the same time do not change the url in the address bar
Used by PHP, apache

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2018-02-02
@flx12

in .htaccess

RewriteEngine On

RewriteCond %{REQUEST_URI} !^/myfolders/.*$
RewriteRule ^(.*)$ /myfolders/$1 [QSA,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question