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的更多相关文章

  1. phpstudy APACHE支持.htaccess以及 No input file specified解决方案

    APACHE支持.htaccess以及 No input file specified解决方案 你的Apache安装文件夹conf里找到httpd.conf文件 索LoadModule rewrite ...

  2. PHP如何让apache支持.htaccess 解决Internal Server Error The server …错误

    TP框架  打开 www.newtp.com/index.php/Home/Index/abc出现 如下错误: Internal Server Error The server encountered ...

  3. 如何让apache支持.htaccess 解决Internal Server Error The server …错误

    如何让apache支持.htaccess 解决Internal Server Error The server …错误 文章来源:小灰博客| 时间:2013-12-25 12:17:08| 作者:Le ...

  4. Apache支持.htaccess配置方法

    打开httpd.conf文件用文本编辑器打开后,查找  代码如下 复制代码 Options FollowSymLinks AllowOverride None 改为: Options FollowSy ...

  5. 让apache支持htaccess文件

    第一:检测 apache是否开启mod_rewrite 通过php提供的phpinfo()函数查看环境配置,在"apache2handler -> Loaded Modules&quo ...

  6. APACHE支持.htaccess以及 No input file specified解决方案

    在你的Apache安装文件夹conf里找到httpd.conf文件 搜索LoadModule rewrite_module modules/mod_rewrite.so 如果前面有注释符号#,请去掉. ...

  7. Apache 支持.htaccess

    ******************************************************************************* Apache 服务器 ********* ...

  8. .htaccess重写URL讲解

    使用ThinkPHP和Laravel等框架的都知道,所以的请求都需要经过index.php文件入口,无论你的URI是什么. 当然除了访问的是静态文件或者访问路径的文件真实存在,例如你访问xxx.com ...

  9. Linux启动Apache支持.htaccess伪静态文件方法

    第一.编辑httpd.conf文件 A - 在etc/httpd/conf/目录下的httpd.conf 文件,找到: LoadModule rewrite_module modules/mod_re ...

随机推荐

  1. Centos7 Python3.x源码安装

    第一步,安装开发工具集 yum -y groupinstall "Development tools" 第二步,安装相关依赖包: yum -y install zlib-devel ...

  2. LeetCode——minimum-path-sum

    Question Given a m x n grid filled with non-negative numbers, find a path from top left to bottom ri ...

  3. Docker Mysql主主同步配置搭建Demo

    主主同步配置和主从配置很相似,仅需稍做修改就可以了,对主从配置有疑问可以查看 上一篇文章. 进行Docker操作前,先建立目录,我的路径是d:/docker/mysql,目录结构如下: --mysql ...

  4. Hue的安装与部署

    Hue的安装与部署 hadoop hue Hue 简介 Hue是一个开源的Apache Hadoop UI系统,最早是由Cloudera Desktop演化而来,由Cloudera贡献给开源社区,它是 ...

  5. 梅森素数应用 nefu 120

    梅森素数 定义: if m是一个正整数 and 2^m-1是一个素数 then m是素数 if m是一个正整数 and m是一个素数 then M(m)=2^m-1被称为第m个梅森数 if p是一个素 ...

  6. 02_zookeeper集群安装

    zookeeper集群安装 (1)   下载zookeeper安装包,并上传到要组成zookeeper集群的多个机器上 我放置的目录:/usr/local/src/zookeeper-3.4.5.ta ...

  7. bzoj 3039: 玉蟾宫 单调栈或者悬线法求最大子矩阵和

    3039: 玉蟾宫 Time Limit: 2 Sec  Memory Limit: 128 MB[Submit][Status][Discuss] Description 有一天,小猫rainbow ...

  8. MySQL索引最左原则

    通过实例理解单列索引.多列索引以及最左前缀原则 实例:现在我们想查出满足以下条件的用户id: 因为我们不想扫描整表,故考虑用索引. 单列索引: ALTER TABLE people ADD INDEX ...

  9. Selenium元素定位问题

    定位元素时,遇到一些诡异事件: 明明就是通过ID定位的,但是就是没有定位到该元素呢? 1.通过element.find_elements_by_xxx()获取该元素的个数,试试是否有获取到元素,0个表 ...

  10. 新男人八题---AStringGame

    终于完成进度男人1/8,为了这题学了sam= = 题意先有一个串,n个子串,两个人轮流每次在子串上加字符,要求加完后还是原串的子串,最后不能加的就是输者,求赢的人 解法:sam之后在构造的状态图上跑s ...