Godaddy主机空间CakePHP .htaccess编写方法

CakePHP的框架默认的.htaccess不能完美支持Godaddy主机空间。也不是Godaddy空间的Htaccess有问题,而是我们没有写好.htaccess。您可以参考如下代码来配置您的CakePHP项目

Godaddy主机CakePHP项目主目录.htaccess
  1. <IfModule mod_rewrite.c>  
  2.     RewriteEngine on   
  3.     RewriteBase /   
  4.     RewriteRule    ^$ app/webroot/    [L]   
  5.     RewriteRule    (.*) app/webroot/$1 [L]   
  6. </IfModule>  
Godaddy主机CakePHP项目App目录.htaccess
  1. <IfModule mod_rewrite.c>  
  2.     RewriteEngine on   
  3.     RewriteBase /   
  4.     RewriteRule    ^$    webroot/    [L]   
  5.     RewriteRule    (.*) webroot/$1    [L]   
  6. </IfModule>  
Godaddy主机CakePHP项目webroot .htaccess
  1. <IfModule mod_rewrite.c>  
  2.     RewriteEngine On   
  3.     RewriteBase /   
  4.     RewriteCond %{REQUEST_FILENAME} !-d   
  5.     RewriteCond %{REQUEST_FILENAME} !-f   
  6.     RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]     
  7. </IfModule>  
版块:Cake文档 Tags: , , 时间:2009-04-13
文章评论
0 回复 for "Godaddy主机空间CakePHP .htaccess编写方法"
phplamp - 2010-03-13
您好,您的评论将出现在这里!
评论表单