您的位置:首页 > 编程语言 > PHP开发

Thinkphp 隐藏 index.php 方法

2012-11-01 19:52 701 查看
方法一

https.ini 中

#

# AllowOverride controls what directives may be placed in .htaccess files.

# It can be "All", "None", or any combination of the keywords:

# Options FileInfo AuthConfig Limit

# AllowOverride All 原来是 none 变为 All

AllowOverride All

建议在虚拟目录中设置

<VirtualHost 127.0.0.1:80>

ServerAdmin admin@163.com

DocumentRoot "D:/www/CarShop"

ServerName www.huifw.com

ServerAlias huifw.com

<Directory "D:\WWW">

Options Indexes FollowSymLinks

AllowOverride All

Order allow,deny

Allow from all

</Directory>

</VirtualHost>

------------------------------------------------------------------------------------------------------------

config.php 中

'URL_MODEL' => 2 ,

------------------------------------------------------------------------------------------------------------

在根目录下面 建立 .htaccess 一定要有 点 ,可以cmd下起名,或是另存为

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

</IfModule>

------------------------------------------------------------------------------------------------------------
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: