繁体   English   中英

GoDaddy CakePHP子文件夹.htaccess规则

[英]GoDaddy CakePHP subfolder .htaccess rules

我需要设置CakePHP的在我的网站的子目录- cms 我尝试了各种.htaccess规则,但出现错误500404错误。 我正在使用cPanel进行GoDaddy Deluxe Linux托管。

以下是我尝试过的。

在CMS文件夹中:

<IfModule mod_rewrite.c>
#Options +FollowSymlinks
RewriteEngine on
RewriteBase /cms/
#RewriteBase /mysite.com/cms/
RewriteRule    ^$ app/webroot/    [L]
RewriteRule    (.*) app/webroot/$1 [L]
</IfModule> 

在CMS>应用程序文件夹中:

<IfModule mod_rewrite.c>
#Options +FollowSymlinks
RewriteEngine on
RewriteBase /cms/
#RewriteBase /mysite.com/cms/
RewriteRule    ^$    webroot/    [L]
RewriteRule    (.*) webroot/$1    [L]
</IfModule>

在CMS>应用> Webroot中:

<IfModule mod_rewrite.c>
#Options +FollowSymlinks
RewriteEngine On
RewriteBase /cms/
#RewriteBase /mysite.com/cms/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

请帮助我获得有效的.htaccess规则。

您需要使用适当的RewriteBase

尝试:

在CMS>应用程序文件夹中:

<IfModule mod_rewrite.c>
#Options +FollowSymlinks
RewriteEngine on
RewriteBase /cms/app/

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

在CMS>应用> Webroot中:

<IfModule mod_rewrite.c>
#Options +FollowSymlinks
RewriteEngine On
RewriteBase /cms/app/webroot/

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

您的/cms/.htaccess看起来不错。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM