I have a project which I have to include within a project.
So .. project A is a web site built on top of custom framework which uses this .htaccess rewrite rules:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]
The second project B is built on top of another custom framework and I am supposed to make it look like a subfolder to the first one.
So I placed project B inside a folder "subfolder". Project B has its own .htaccess which looks like this:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?request=%{REQUEST_URI}&%{QUERY_STRING} [NE,L]
I want to merge them into a single .htacess file and tell to Apache something like :
if we have a parameter /subfolder redirect everything to subfolder/index.php
else redirect everything to index.php
Any ideas how can I do it?
What you’re supposed to do is:
For the first project, this htaccess file is in the document root
Then in the second project, this htaccess file is in the
subfolderdirectory:If for some reason that’s not working for you, I guess a combined htaccess file, one that resides in the document root, would look like this:
Will probably need a bit more tweaking.