Thinkphp 隐藏 index.php 方法

来源:互联网 发布:淘宝上有什么好东西 编辑:程序博客网 时间:2024/05/18 02:02

方法一

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>

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

原创粉丝点击