As the title says, I have the root directory that contains pages and I have another directory that it’s called mobile.
I would like the pages that are inside the root directory to be all redirected to index.php in root, as for the mobile directory I want all the pages inside it to be redirected to the other index.php that is inside /mobile
I have tried multiple times but it seems that sometimes I can only get one folder working at a time.
Any help would be much appreciated !
Thank you
2
Answers
Paste this code both in site root .htaccess and
mobile/.htaccess
:Use Nginx. 😉
Example.
Skills required: RegEx (
~
).The HTTP status code 302 causes your browser to switch to this page. I don’t like 301 so much when developing, because your browser remembers the redirects or caches them.
With the location blocks it depends of course also on the order.