正则表达式 – 如何在1and1共享主机上为Cake 2.3.x配置htaccess
对不起,我做了很多搜索,但没有找到解决问题的方法.
当我想在子文件夹中安装Cakephp应用程序时,使用默认的cakephp htaccess文件设置将无法在我的域上运行,而所有内容都适用于localhost(xampp) target => http://mydomain.com/mycakeapp 安装需要3个htaccess文件: root .htaccess #.htaccess in root RewriteEngine on RewriteBase /mycakeapp RewriteRule ^$app/webroot/ [L] RewriteRule (.) app/webroot/$1 [L] ????在应用程序.htaccess RewriteEngine on RewriteBase /mycakeapp RewriteRule ^$ app/webroot/ [L] RewriteRule (.) app/ webroot/$1 [L] ????在webroot .htaccess中 RewriteEngine On RewriteBase /mycakeapp RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$index.php [QSA,L] 在cakephp文档和使用这些htaccess文件之后,我得到了error500结果. php是5.4版本 解决方法
像这样设置你的规则:
DOCUMENT_ROOT中的.htaccess RewriteEngine on RewriteBase / RewriteRule (.*) mycakeapp/$1 [L] DOCUMENT_ROOT / mycakeapp中的.htaccess RewriteEngine on RewriteBase /mycakeapp/ RewriteRule (.*) app/webroot/$1 [L] DOCUMENT_ROOT / mycakeapp / app中的.htaccess RewriteEngine on RewriteBase /mycakeapp/app/ RewriteRule (.*) webroot/$1 [L] DOCUMENT_ROOT / mycakeapp / app / webroot中的.htaccess RewriteEngine On RewriteBase /mycakeapp/app/webroot/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |