YII的重写规则

如果不用内置sever去开发项目,输入网址会报object ........,则按照下列步骤即可使用安装开发环境

yii写的网站根目录在web下

第一步:要在httpd.conf中打开apache的rewrite模块

第二步:

在web下建立.htaccess文件,文件内容如下

  1. <IfModule mod_rewrite.c>   
  2.   
  3.   
  4. Options +FollowSymLinks  
  5. IndexIgnore */*  
  6. RewriteEngine on  
  7.   
  8. # if a directory or a file exists, use it directly  
  9. RewriteCond %{REQUEST_FILENAME} !-f  
  10. RewriteCond %{REQUEST_FILENAME} !-d  
  11.   
  12. # otherwise forward it to index.php  
  13. RewriteRule . index.php  
  14.   
  15.   
  16. </IfModule>  


此时在打开apache,输入网址,即可
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章