thinkphp3.2.3 隐藏url上home模块以及index.php文件

1.去掉Home

index.php  添加如下代码

define('BIND_MODULE', 'Home');

这时就隐藏了url中的Home

2.去掉index.php

thinkphp3.2.3,官网自带的.htaccess文件内不好使。
  1.httpd.conf 中去掉LoadModule rewrite_module modules/mod_rewrite.so 前面的#
  2.AllowOverride None 修改为了AllowOverride All
  3.config文件中添加以下配置: 
  // URL地址不区分大小写
  'URL_CASE_INSENSITIVE' => true,
  //REWRITE模式
  'URL_MODEL' => 2,
  4.根目录.htaccess如果没有自己建也可以。
  <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    Rewritebase /index.php
    RewriteRule ^(.*)$ /index.php?/$1 [L]
  </IfModule>

原文地址:https://www.cnblogs.com/holyson/p/8777165.html