Last active
January 30, 2019 10:34
-
-
Save dizyart/4733257 to your computer and use it in GitHub Desktop.
.htaccess to allow subdirectory access parallel to a CakePHP app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REQUEST_URI} !^/(?:development|cgi-bin|v1\.5|phpMyAdmin)(?:$|/) | |
RewriteRule ^$ app/webroot/ [L] | |
RewriteCond %{REQUEST_URI} !^/(?:development|cgi-bin|v1\.5|phpMyAdmin)(?:$|/.*) | |
RewriteRule (.*) app/webroot/$1 [L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
May be you are looking to access a subfolder in the same CakePHP Installation , by doing so , let's assume that you are trying to access phpMyAdmin in cakephp Root Folder where .htaccess exists ( in the Root Folder , where vendor exists and before moving to /app ) , the .htaccess will be as follows :
without doing so , when you type http://path_to_cakephp_root_folder_in_htdocs_or_www/phpMyAdmin , you will get a cakephp error page assuming that you are trying to access a controller named phpMyAdmin ...
With that update , when you type the same URL , you will get phpMyAdmin instead ...
Hopes it help ...
Sorry for the late answer and the bad english ...