Apache重写路由,隐藏index.php
2017-08-02 00:00
309 查看
1、确保Apache配置文件httpd.conf的 mod_rewrite.so 模块开启。方法:去掉前面的 “#”
2、在项目入口文件的同级目录下(即index.php所在目录),新建 .htaccess 文件,内容为:
3、重启Apache,原来的访问地址 http://domainName/index.php/user/login 就可简化为 http://domainName/user/login
2、在项目入口文件的同级目录下(即index.php所在目录),新建 .htaccess 文件,内容为:
Options +FollowSymLinks IndexIgnore */* 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
3、重启Apache,原来的访问地址 http://domainName/index.php/user/login 就可简化为 http://domainName/user/login
相关文章推荐
- Apache重写路由,隐藏index.php
- apache rewrite重写隐藏index.php
- 西部数码虚拟主机iis怎么路由重写,去除隐藏index.php
- 利用重写规则隐藏index.php
- 【laravel】laravel5环境隐藏index.php后缀(apache)
- Apache 里面隐藏TP框架地址中的index.php
- tp5.0.11URL重写隐藏应用的入口文件index.php
- apache 配置rewrite模块,URL中隐藏index.php
- nginx 隐藏index.php 并开启rewrite日志调试(apache也有)
- nginx重写url隐藏index.php
- ubuntu apache下设置隐藏index.php
- 关于ThinkPHP5.0在Apache下隐藏index.php报错的问题
- apache隐藏index.php
- ThinkPHP中通过URL重写隐藏应用的入口文件index.php的相关服务器的配置
- apache(.htaccess)、nginx的URL重新--隐藏index.php
- apache服务器开启rewrite模式(隐藏index.php)
- nginx重写规则隐藏index.php
- Apache重写去除入口文件index.php
- apache 配置虚拟目录+默认页+隐藏index.php
- thinkPHP Apache 优化url,隐藏index.php所需配置