最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
wampp环境使用别名alias下用mod_rewrite方法
时间:2022-06-30 18:03:45 编辑:袖梨 来源:一聚教程网
使用wampp新建alias的时候,默认是无法使用mod_rewrite模块。
需要做一些配置:
1、wampp开启mod_rewrite
2、在alias配置文件里加入如下代码,请自行根据情况修改。
| 代码如下 | 复制代码 |
| Alias /labs/ "E:/ecc_ecd_rep/labs_proj/trunk/" Options Indexes FollowSymLinks AllowOverride All Order deny,allow allow from all |
|
其中关键的是这句AllowOverride All 允许使用mod_rewrite模块
3、在.htaccess文件中,需要使用RewriteBase,不然rewrite无法生效。
举个例子:
| 代码如下 | 复制代码 |
| RewriteEngine On # Some hosts may require you to use the `RewriteBase` directive. # If you need to use the `RewriteBase` directive, it should be the # absolute physical path to the directory that contains this htaccess file. # RewriteBase /labs/jdpat/import/api/ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [QSA,L] |
|
加上这句RewriteBase /labs/jdpat/import/api/ 即可。
相关文章
- 巨神军师蜀国核心阵容是什么 12-10
- 阿凡达潘多拉边境萌芽守护者全收集攻略 菌丝网络位置大全 12-10
- 夜幕之下提线人队伍如何搭配 12-10
- 阿凡达潘多拉边境怎么收武器 武器收回按键介绍 12-10
- 阿凡达潘多拉边境数据采集站位置全收集攻略 12-10
- 暗喻幻想全角色介绍 全人物图鉴一览 12-10
