关于TP框架隐藏index.php
2017-12-04 18:17
381 查看
保证下面这些基础的东西都改掉
1. 确认httpd.conf配置文件中加载了mod_rewrite.so模块
2. AllowOverride None 将None改为 All;允许读取.htaccess文件
3. 打开Myapp/Conf/config.php文件,在配置的数组中添加一行:
'URL_MODEL'=>2,
4. 在入口文件所在的同级目录下,新建一个.htaccess文件,内容是:
如果以上还不行的话,可以试试下面这些方法:
1、在.htaccess这个文件中,框架初始的内容是:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
只需要改成这样(只有最后一行有所改变):
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
2、
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>
1. 确认httpd.conf配置文件中加载了mod_rewrite.so模块
2. AllowOverride None 将None改为 All;允许读取.htaccess文件
3. 打开Myapp/Conf/config.php文件,在配置的数组中添加一行:
'URL_MODEL'=>2,
4. 在入口文件所在的同级目录下,新建一个.htaccess文件,内容是:
1、在.htaccess这个文件中,框架初始的内容是:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
只需要改成这样(只有最后一行有所改变):
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
2、
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>
相关文章推荐
- Apache 里面隐藏TP框架地址中的index.php
- TP框架隐藏index.php和Home的访问名
- ci框架&tp框架隐藏index.php
- TP框架隐藏 index.php
- CI框架 .htaccess 隐藏url在index.php解决方案
- CodeIgniter框架中关于URL重写(index.php)的二三事
- CodeIgniter框架中关于URL(index.php)的那些事
- ThinkPHP框架里隐藏index.php
- Debian8环境下thinkphp框架隐藏index.php
- CI框架 .htaccess 隐藏url中index.php的解决
- CI框架 .htaccess 隐藏url中index.php的解决(转)
- CI框架 .htaccess 隐藏url在index.php解决方案
- CI 框架怎么去掉隐藏入口文件 index.php
- CI 框架隐藏index.php-ubuntu
- 教你如何在CI框架中使用 .htaccess 隐藏url中index.php
- 教你如何在CI框架中使用 .htaccess 隐藏url中index.php
- 分享CodeIgniter框架中关于URL(index.php)的那些事
- 隐藏CI框架路径中的index.php方法
- php中关于ci框架修改后缀并去掉url中的index.php
- 关于ThinkPHP隐藏index.php