重写别名目录 [英] Rewrite an Alias directory

查看:80
本文介绍了重写别名目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图首先使用Alias文件夹将项目文件存储在与DocumentRoot不同的位置,然后对该请求执行mod_rewrite.但是,它似乎没有解析.htaccess文件.

I'm trying to first use an Alias folder to store my project files in a different location than my DocumentRoot, and then execute a mod_rewrite on this request. However it doesn't seem to parse the .htaccess file.

这是我的Alias文件的内容:

This is the content of my Alias file:

Alias /test F:/Path/To/Project

<Directory F:/Path/To/Project>
    Order allow,deny
    Allow from all
</Directory>

这是我的.htaccess文件:

Options +FollowSymlinks
RewriteEngine on

RewriteRule .* index.php [NC] [PT]

当我删除别名时,一切正常.

When I remove the Alias everything works fine.

推荐答案

mod_alias始终优先于mod_rewrite.您永远无法使用mod_rewrite覆盖mod_alias指令.

mod_alias ALWAYS takes precedence over mod_rewrite. You can never override a mod_alias directive with mod_rewrite.

在这种情况下, AliasMatch指令可能会对您有所帮助.

The AliasMatch directive may help you in this case.

这篇关于重写别名目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆