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 ...
随机推荐
- this 的理解
function foo(num){ console.log("foo:",+num); this.count++}foo.count =0for (var i=0; i<1 ...
- websocket 重连解决方案
1.websocket 重连的脚本:https://github.com/joewalnes/reconnecting-websocket reconnecting-w ...
- python学习笔记glob模块
python有许多的类库,现将学习记录下来,以供以后回顾复习: 1.glob模块 用于文件名操作,匹配指定目录下的文件,返回的是目录加文件名,常用的有两个函数: glob(pattern),返回匹配的 ...
- TIME_WAIT和CLOSE_WAIT
先看下三次握手四次挥手的状态变化: 通常会遇到下面两种情况: 服务器保持了大量TIME_WAIT状态 服务器保持了大量CLOSE_WAIT状态 因为linux分配给一个用户的文件句柄是有限的,而TIM ...
- MyEclipse2014.Maven自动更新
1.我把 "Do not automatically update dependencies from remote repositories" 和 "Download ...
- python学习大纲目录(转自alex博客https://www.cnblogs.com/alex3714/)
day01: 介绍.基本语法.流程控制 Python介绍 发展史 Python 2 or 3? 安装 Hello World程序 变量 用户输入 模块初识 .pyc是个什么鬼? 数据类型初识 数据运算 ...
- spring mvc: 多动作控制器(Controller下面实现多个访问的方法)MultiActionController / BeanNameUrlHandlerMapping
spring mvc: 多动作控制器(Controller下面实现多个访问的方法) 比如我的控制器是UserController.java,下面有home, add, remove等多个方法 访问地址 ...
- HIVE学习(待更新)
1 安装hive 下载 http://mirrors.shu.edu.cn/apache/hive/hive-1.2.2/,红框中的不需要编译. 由于hive是默认将元数据保存在本地内嵌的 Derby ...
- POJ-3659-最小支配集裸题/树形dp
Cell Phone Network Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7127 Accepted: 254 ...
- HDU 4815 概率dp,背包
Little Tiger vs. Deep Monkey Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K ( ...