欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Yii隱藏URL中index.php的方法

 更新時(shí)間:2016年07月12日 16:15:30   作者:Flowf  
這篇文章主要介紹了Yii隱藏URL中index.php的方法,涉及Yii配置文件的設(shè)置與偽靜態(tài)的配置技巧,需要的朋友可以參考下

本文實(shí)例講述了Yii隱藏URL中index.php的方法。分享給大家供大家參考,具體如下:

一、修改config/下的main.php里的:

'urlManager'=>array(
      'urlFormat'=>'path',
      'showScriptName'=>false,
   'rules'=>array(
      '<controller:\w+>/<id:\d+>'=>'<controller>/view',
      '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
      '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
      ),
),

二、修改網(wǎng)站根目錄下.htaccess文件內(nèi)容如下:

Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php

更多關(guān)于Yii相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《Yii框架入門及常用技巧總結(jié)》、《php優(yōu)秀開發(fā)框架總結(jié)》、《smarty模板入門基礎(chǔ)教程》、《php日期與時(shí)間用法總結(jié)》、《php面向?qū)ο蟪绦蛟O(shè)計(jì)入門教程》、《php字符串(string)用法總結(jié)》、《php+mysql數(shù)據(jù)庫操作入門教程》及《php常見數(shù)據(jù)庫操作技巧匯總

希望本文所述對(duì)大家基于Yii框架的PHP程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論