mod_rewrite 还是 mod_alias? [英] mod_rewrite or mod_alias?

查看:37
本文介绍了mod_rewrite 还是 mod_alias?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个服务器,它的 httpd.conf 中已经有一些RedirectMatch 永久"指令.

I have a server, its httpd.conf already has some "RedirectMatch permanent" directives in it.

我对 mod_alias 不太熟悉,我只用过 mod_rewrite.

I'm not that familiar with mod_alias, I've only ever used mod_rewrite.

基本的区别是什么?我在 mod_alias 中没有看到L"标志来停止处理规则.

What's the basic difference? I don't see a "L" flag in mod_alias to stop processing rules.

对于从一个子域重定向到另一个子域的最佳实践,我应该使用哪个?

Which one should I use for best practices of redirecting from one sub-domain to another?

我可以同时使用两者吗,哪个优先?

Can I use both at the same time and will it be obvious which takes precedence?

推荐答案

mod_alias 基本上是 mod_rewrite 的简单版本.它不能做一些 mod_rewrite 可以做的事情,比如操作查询字符串.如果您可以选择其中任何一个,我看不出您有任何理由想要使用 mod_alias.

mod_alias is basically a simpler version of mod_rewrite. It can't do some things that mod_rewrite can, such as manipulate the query string. If you're able to choose either of them, I don't see any reason that you'd want to use mod_alias.

是否有特定原因需要尝试同时使用两者?

Is there a specific reason you need to try to use both together?

Apache mod_rewrite &你应该知道的 mod_alias 技巧 似乎是一篇关于这两者的好文章.它曾指出 mod_rewrite 规则在 mod_alias 规则之前执行.

Apache mod_rewrite & mod_alias tricks you should know seems to be a good article about the two. It notes at one point that mod_rewrite rules get executed before mod_alias ones.

这篇关于mod_rewrite 还是 mod_alias?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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