E
E
Eka5552016-10-29 15:56:57
htaccess
Eka555, 2016-10-29 15:56:57

How to make double rewrite base?

Greetings to all.
There is such a .htacces file:

RewriteBase /

RewriteEngine On

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule .* index.php?q=$0 [QSA,L]

It redirects everything to index.php
How can I make it so that if the URL is: mysite.com/cms
It redirects to index.php which is in the "cms" folder, and all other links like http:// mysite.com/blabla redirected to index.php which is in the "public" folder.
I hope you understand the question)
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Dmitruk, 2016-10-31
@webdevlix

Hello!
The answer to your question is elementary, so point by point:
1.Go to the CMS folder
2.Create the .htaccess file
3.Write the following code there

RewriteBase /cms/

RewriteEngine On

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule .* index.php?q=$0 [QSA,L]

That's all, according to the rules of the .htaccess below, it overrides the actions of the one above.
I hope I solved your question!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question