S
S
stainer2018-12-10 22:33:12
Apache HTTP Server
stainer, 2018-12-10 22:33:12

How to redirect requests to a pack?

Good evening.
Installed Openserver (php7+apache 2.4).
The project has become available at localhost. Then I set up an alias on the /public_html/ folder for the main domain.
All OK. The mobile version of the site is located in the /public_html/mobile/ folder. I set up an alias for it, but requests go to the /public_html/m/ folder, not /public_html/mobile/.
Tell me how to redirect all static and php requests to the /public_html/mobile/ folder

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
akdes, 2018-12-11
@akdes

If I understand correctly, then we write in .htaccess:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /public_html/mobile/?path=$1 [NC,L,QSA]

but because requests go to "/public_html/m/" - somewhere, it should be spelled out...!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question