【发布时间】:2013-06-20 08:33:44
【问题描述】:
我想将我的 CakePHP 应用从 localhost 部署到网络服务器,但我得到了Error 500。
我的文件夹结构如下所示(注意:Cake-app 不在根目录中...)。 .htaccess-files (0) - (3) 是根据 this post [SO]: 的,因为这是一个 CakePHP&Wordpress 服务器,所以我尝试了 this advice here, too [SO]。
该应用程序显然位于CAKEAPP-文件夹中,其中一个子域cakeapp.mydomain.com 指向。
ROOT
├── .htaccess (0)
├── CAKEAPP
│ ├── .htaccess (1)
│ ├── app
│ │ ├── .htaccess (2)
│ │ ├── WEBROOT
│ │ │ ├── .htaccess (3)
├──{wordpress-files}
(0) .htaccess 在ROOT 文件夹中
Action php /cgi-php52/php
AddHandler php52 .php
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
php_value memory_limit "128M"
#BEGIN Image Upload HTTP Error Fix
<IfModule mod_security.c>
<Files async-upload.php>
</Files>
</IfModule>
<IfModule security_module>
<Files async-upload.php>
</Files>
</IfModule>
<IfModule security2_module>
<Files async-upload.php>
</Files>
</IfModule>
#END Image Upload HTTP Error Fix
(1) .htaccess 在CAKEAPP-文件夹中
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
(2) .htaccess 在ROOT/CAKEAPP/APP-文件夹中
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /app/
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
(3) .htaccess 在ROOT/CAKEAPP/APP/WEBROOT-文件夹中
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /app/webroot
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
【问题讨论】:
-
│ │ ├── WEBROOTwebroot,可能就是这样。原则上,您无需将蛋糕应用程序放入子文件夹中
标签: wordpress .htaccess cakephp mod-rewrite