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. 【读书笔记】《深入浅出nodejs》第四章 异步编程

    1. 异步编程的基础 -- 函数式编程 (1)高阶函数 -- 是可以把函数作为参数,或是将函数作为返回值的函数. (2)偏函数用法 -- 创建一个调用另外一个部分 -- 参数或变量已经预置的函数 -- ...

  2. 通过Excel生成批量SQL语句

    项目中有时会遇到这样的要求:用户给发过来一些数据,要我们直接给存放到数据库里面,有的是Insert,有的是Update等等,少量的数据我们可以采取最原始的办法,也就是在SQL里面用Insert int ...

  3. 解决node-sass安装不了的问题

    1.下载https://github.com/sass/node-sass-binaries/blob/master/win32-x64-48_binding.node到E:\primeng\lib目 ...

  4. 【cs231n】神经网络学习笔记3

    + mu) * v # 位置更新变了形式 对于NAG(Nesterov's Accelerated Momentum)的来源和数学公式推导,我们推荐以下的拓展阅读: Yoshua Bengio的Adv ...

  5. css 固定宽度,自动换行

    max-width: 200px; display: block; word-break: break-all:

  6. springboot项目属性配置及注意事项

    在idea编辑器建的springboot项目中的resources包下的application.properties这个就是配置文件. 另外配置文件的文件名还可以是application.yml,在r ...

  7. python selenium常用基本方法---H5和键盘鼠标操作

    一.模拟手机打开页面(H5测试) from selenium import webdriver mobile_emulation = {'deviceName':'iPhone X'} options ...

  8. iometer测试磁盘IO性能

    of Outstanding I/Os per target – 被选中worker的每个磁盘一次所允许的未处理的异步I/O的数量.模拟测试多个应用向 IO 请求读写,默认是 1.通常不用这个参数,除 ...

  9. LeetCode 525. Contiguous Array

    525. Contiguous Array Add to List Description Submission Solutions Total Accepted: 2476 Total Submis ...

  10. Python之匿名函数(filter,map,reduce)

    参考博客:Python匿名函数详解--http://blog.csdn.net/csdnstudent/article/details/40112803 Python内建函数之——filter,map ...