apache 支持.htaccess重写url
1. httpd.conf
添加:
<Directory />
Options +Indexes +FollowSymLinks +Multiviews
AllowOverride all
Require all granted
RewriteEngine On </Directory>
开启:

在phpinfo里找到:

说明开启成功。
2.httpd-vhosts.conf (开启虚拟主机的情况下)
注意这里的
Options Indexes FollowSymLinks 容易出错,要明白每个参数的作用!!!
添加:
<VirtualHost *:80>
ServerName "wap.500new.com"
DocumentRoot "C:/wamp/www/lottery_frontnew_wrap/web"
<Directory "C:/wamp/www/lottery_frontnew_wrap/web">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
3.在网站根目录添加:

例如内容:
RewriteEngine On
#RewriteBase /front
RewriteRule ^(\w+)/(\w+)\.html$ index.php?act=$1&op=$2 [QSA]
4.在php里写:
var_dump($_GET);exit(0);
浏览器显示:

说明.htaccess配置生效
apache 支持.htaccess重写url的更多相关文章
- phpstudy APACHE支持.htaccess以及 No input file specified解决方案
APACHE支持.htaccess以及 No input file specified解决方案 你的Apache安装文件夹conf里找到httpd.conf文件 索LoadModule rewrite ...
- PHP如何让apache支持.htaccess 解决Internal Server Error The server …错误
TP框架 打开 www.newtp.com/index.php/Home/Index/abc出现 如下错误: Internal Server Error The server encountered ...
- 如何让apache支持.htaccess 解决Internal Server Error The server …错误
如何让apache支持.htaccess 解决Internal Server Error The server …错误 文章来源:小灰博客| 时间:2013-12-25 12:17:08| 作者:Le ...
- Apache支持.htaccess配置方法
打开httpd.conf文件用文本编辑器打开后,查找 代码如下 复制代码 Options FollowSymLinks AllowOverride None 改为: Options FollowSy ...
- 让apache支持htaccess文件
第一:检测 apache是否开启mod_rewrite 通过php提供的phpinfo()函数查看环境配置,在"apache2handler -> Loaded Modules&quo ...
- APACHE支持.htaccess以及 No input file specified解决方案
在你的Apache安装文件夹conf里找到httpd.conf文件 搜索LoadModule rewrite_module modules/mod_rewrite.so 如果前面有注释符号#,请去掉. ...
- Apache 支持.htaccess
******************************************************************************* Apache 服务器 ********* ...
- .htaccess重写URL讲解
使用ThinkPHP和Laravel等框架的都知道,所以的请求都需要经过index.php文件入口,无论你的URI是什么. 当然除了访问的是静态文件或者访问路径的文件真实存在,例如你访问xxx.com ...
- Linux启动Apache支持.htaccess伪静态文件方法
第一.编辑httpd.conf文件 A - 在etc/httpd/conf/目录下的httpd.conf 文件,找到: LoadModule rewrite_module modules/mod_re ...
随机推荐
- Qt、MVB
使用的陪测网卡是[众志诚MVB网卡],通过串口配置,可以接收和发送MVB数据. 一.MVB通信介绍 对于某一节点[如众志诚MVB网卡],为其配置0x710和0x720端口为源端口,用于发送数据,为其配 ...
- 关于JavaScript对象中的一切(一) -- 对象属性
先上一张我制作的脑图.
- 定制Writable类
以IntWritable为例介绍,定制writable的步骤 //继承 WritableComparable接口(继承了writable接口和comparable接口) public class In ...
- Spring Boot 上传图片文件
步骤一:基于前面springboot入门小demo 基于的springboot入门小demo,已包含了前面文章的知识点(比如:热部署.全局异常处理器). 步骤二:创建uploadPage.jsp上传页 ...
- 搭建时间服务器(linux)
我们搭建集群环境的时候,时间必须是要统一的,才能保证集群数据的一致性. 一般操作是直接使用NTP,跟默认的时间服务器同步,但是最好还是让所有节点跟集群中的某台作为时间服务器的节点同步. 步骤:(节点有 ...
- 我的nlp之路(1)
1/8日任务 基础篇: 如何使用远程连接从windows或者linux连到服务器进行操作(切换用户,传递文件) (严禁使用root账户) Linux基本bash命令 a) 查看文件大小, ...
- ANDROID教程目录
html5 如何打包成apk,将H5封装成android应用APK文件的几种方法
- springboot的controller使用及url参数的获取
类上加上@RequestMapping其访问的地址就是类上的加上方法上的菜能访问到该方法,例如上图的地址就是/hello/say @RequestMapping(value = "/hell ...
- Mybatis-Generator插件的使用与Spring集成Mybatis的配置
参考:http://blog.51cto.com/zero01/2103687 Mybatis-Generator是一个用于自动生成dao层接口.pojo以及mapper xml的一个Mybatis插 ...
- python 函数、模块、包及import导入方法
https://www.cnblogs.com/lijunjiang2015/p/7812996.html