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. MySQL_ERROR 1231 (42000) at line XX in file 'file_name' Variable 'time_zone' can't be

    类似的错误信息如下 ERROR 1231 (42000) at line 10370 in file: '/root/sql/ultrax_170322.dmp': Variable 'time_zo ...

  2. 【Discriminative Localization】Learning Deep Features for Discriminative Localization 论文解析(转)

    文章翻译: 翻译 以下文章来源: 链接

  3. nginx for windows 中虚拟主机路径设置问题

    由于Windows版本的Nginx其实是在Cygwin环境下编译的,所以Nginx使用的是Cygwin的路径格式,所以在Nginx的配置文件nginx.conf中,路径既不能使用*nix的格式,也不能 ...

  4. ScrambleString, 爬行字符串,动态规划

    问题描述: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty su ...

  5. Codeforces Round #341 (Div. 2) C. Mike and Chocolate Thieves 二分

    C. Mike and Chocolate Thieves time limit per test 2 seconds memory limit per test 256 megabytes inpu ...

  6. 学习webpack3.x过程中遇到的问题:webpack-dev-server

    这篇博客主要记录的是本人在学习webpack3.x的过程中遇到的问题(虽然这几天4.0刚出来,但是我还是先学一下3.x吧) 1.配置文件可以用webpack启服务和热更新,步骤如下: ① 先下载:we ...

  7. ContentPresenter元素

    一个内容控件 分解它的“结构树”,肯定能够看到ContentPresenter“元素”,该元素的功能:用来为“内容控件”显示“Content”

  8. Lograge(2350✨) 在产品环境显示定制改良的日志输出。

    Lograge https://github.com/roidrage/lograge 改良Rails默认的请求日志的记录. 它会精明的处理好那些noisy和无用的,未解析的,在context中运行多 ...

  9. tcp/ip学习笔记-TCP

    tcp/ip学习笔记-TCP 彭会锋 报文发送采用的是tcp_output函数,

  10. 重新学习MySQL数据库6:浅谈MySQL的中事务与锁

    『浅入深出』MySQL 中事务的实现 在关系型数据库中,事务的重要性不言而喻,只要对数据库稍有了解的人都知道事务具有 ACID 四个基本属性,而我们不知道的可能就是数据库是如何实现这四个属性的:在这篇 ...