0

My first .htaccess file in root folder:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^$ app/webroot/ [L]
    RewriteRule (.*) app/webroot/$1 [L]
</IfModule>

My second .htaccess file in webroot folder:

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

My third .htaccess file in src folder:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>

After doing this it results in a 500 internal server error in CakePHP 3.

halfer
  • 19,824
  • 17
  • 99
  • 186
Sorav Garg
  • 1,116
  • 1
  • 9
  • 26
  • 2
    I notice that a number of your questions include "please help" and sometimes "urgent" - it's worth bearing in mind that these will generally get edited out, and that some readers so dislike requests for urgency that they will downvote the question. Do remember that all readers are volunteers here, and all questions are of equal importance. – halfer Aug 24 '15 at 21:48
  • 1
    What evidence makes you think it's a .htaccess problem? From what you've presented, it could just as well be a coding or configuration error in your application. – Greg Schmidt Aug 24 '15 at 22:06
  • i found solution in cakephp 2.0 we need three htaccess file but in cakephp 3.0 we need only 2 cakephp file (root directory, webroot folder).. In root directory -- RewriteEngine on RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] in webroot folder -- RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] – Sorav Garg Apr 24 '16 at 16:23

2 Answers2

2

I would first try double checking your init process verse the cakePHP3 docs http://book.cakephp.org/3.0/en/installation.html -- not knowing more of your local setup, this is where I would start

0

Change every

RewriteEngine on

By this

RewriteEngine on
RewriteBase /
Mohammed Elhag
  • 4,272
  • 1
  • 10
  • 18