Skip to main content

Cakephp rewrite .htaccess rule to allow access of a main root folder

Cakephp rewrite .htaccess rule to allow access of a main root folder

This solution will work with any framework so you can use it in any php frameworks

In CakePHP sometime  we want to allow a folder access that exists on the root access but CakePHP do not allow us to any main root file directly so here is the simple solution of this issue

Go to your directory that you want to allow public access


Now create a new .htaccess file in it. For example my project folder name is cakeapp and "foldername" is our folder name that we want to allow access,  then my new .htaccesss file location will be cakeapp/foldername/.htaccess

Now paste below code in it

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

</IfModule>


Thats it , now go to browser and try to access it directly. :)


Related Links

allow access to a specific folder in root directory

.htaccess prevent access of root folder except one.





Comments