Using files in a subdirectory as a root path on Apache

Is there a way to use a subdirectory as root path on Apache?

Must I use .htaccess?

But I can't find a redirect that works.

The only one was: RewriteRule ^(.*).htm$ app/$1.php [QSA,NC,L]

In this case I need to change the extension.

If I try to use the same extension on the rule, it seems that Apache enters into recursion.

I want to use an address like: http://localhost/myPrjFolder/customers.php and in file system actually is: {document.root}/myPrjFolder/app/customers.php

Well yes, your match also maches the output of your rewrite, try excluding slashes from the match:

RewriteRule ^([^/]+)\.htm$ app/$1.htm [QSA,NC,L]

Or whatever extension, that should set you on the right track.

0 Comment



Captcha image