There is a website with CMS croogo written on cake.php . I added a page written in php to the root of the site (I tried it with php, html, ctp extensions), but I can’t access it directly or from another page - I get a security error: enter image description here may be the case in the file .htaccess

 DirectoryIndex index.php index.html index.htm index.php5 #AddDefaultCharset UTF-8 #Options ExecCGI Includes IncludesNOEXEC IncludesNOEXEC SymLinksIfOwnerMatch Indexes -Indexes #RewriteEngine On #Options FollowSymLinks #RewriteRule ^ index.php <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule> 

App / webroot / link to another file .htaccess with the following content

 <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?/$1 [QSA,L] </IfModule> 

those. The rule RewriteRule ^(.*)$ index.php?/$1 [QSA,L] just blocks access and you need to remove or add - how to solve?

  • one
    can you familiarize yourself with how the cakephp framework functions at all before adding different pages to the site root? - teran
  • Check if you have mod_rewrite turned - Roman Kozin
  • one
    @ Vasya, I now install it and try to create something. Worked with keyk 3.x - Roman Kozin
  • one
    @ Vasya, you need not just add a php file. You need to create a controller class ( src\Controllers ) and implement the required action (class method) with your logic and conditions. Next, match the URL route ( configs\routes.php ) to this action and controller. Then create a view src\template\YourControllerName\ActionName.ctp where to display the data. This is a classic MVC model, implemented in cakephp - teran
  • one
    @ Vasya prescribe RewriteRule in .htaccess - teran

0