yii 1.0 index.php怎么隱藏

yii1.0隱藏index.php的方法:首先打開“httpd.conf”文件;然后開啟“mod_rewrite.so”;接著將相對(duì)應(yīng)目錄的“AllowOverride”改為ALL;最后在index.php同級(jí)目錄下新建.htaccess。

yii 1.0 index.php怎么隱藏

本文操作環(huán)境:windows7系統(tǒng)、yii1.0版,DELL G3電腦

YII 1.0 隱藏單入口index.php 設(shè)置路由與偽靜態(tài)

隱藏 index.php

保證apache配置文件httpd.conf里的LoadModule
rewrite_module modules/mod_rewrite.so開啟(去掉#)
將相對(duì)應(yīng)目錄的AllowOverride 改為ALL
在根目錄下,即在index.php同級(jí)目錄下新建.htaccess

立即學(xué)習(xí)PHP免費(fèi)學(xué)習(xí)筆記(深入)”;

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

?設(shè)置main.php 中的路由規(guī)則

//?uncomment?the?following?to?enable?URLs?in?path-format 		'urlManager'=&gt;array( 			'urlFormat'=&gt;'path', ????????????'showScriptName'?=&gt;false, 			'rules'=&gt;array( ????????????????'index.html'=&gt;array('index'), ????????????????'article/<id:>'?=&gt;?array('article/index','urlSuffix'=&gt;'.html'), ????????????????'category/<id:>/<page:>'?=&gt;?array('category/index','urlSuffix'=&gt;'.html'), ????????????????'category/<id:>/1'?=&gt;?array('category/index','urlSuffix'=&gt;'.html'), 			), 		),</id:></page:></id:></id:>

推薦:《yii教程

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊5 分享