Cakephp 3 .htaccess文件配置

时间:2017-05-02 10:27:19

标签: php apache .htaccess cakephp mod-rewrite

我花了很多时间找出这个麻烦,我的cakephp在我的localhost服务器上运行,但是当我将cakephp移动到托管服务器时,cakephp只显示空白页面,任何人都在根目录中有代码.htaccess文件夹,cakephp文件夹,还有另一个需要我的cakephp在服务器上运行?

我的cakephp版本是cakephp 3

我尝试过这段代码

  1. 在根.htaccess

    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteRule ^index\.php$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.php [L]
    </IfModule>
    
  2. 在我的文件夹cakephp .htaccess

    <IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteBase /my_app_name
      RewriteRule ^$ webroot/ [L]
      RewriteRule (.*) webroot/$1 [L]
    </IfModule>
    
  3. 我的webroot文件夹中的
  4. <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
    </IfModule>
    
  5. 对于我读过的很多教程,他们说我们设置了3个.htaccess文件,我的.htaccess文件中是否有错误的代码,所以我无法访问我的网站?

    [CASE CLOSED]

    解决方案只是确保您的php已在您的托管/共享服务器中启用了intl

0 个答案:

没有答案