阿帕奇从根重定向 [英] Apache redirect from root
本文介绍了阿帕奇从根重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是想知道如何从根Apache的执行重定向。
我要检查,如果有人去根URL(如: example.com
),并将其重定向到 example.com/h
自动。
我能做到这一点的Apache的配置,或者在的.htaccess
文件?
解决方案
了NameVirtualHost *:80
<虚拟主机*:80>
服务器名example.com
RedirectMatch 301 ^ / $ /小时
< /虚拟主机>
这将帮助您重定向从 example.com
您所有的要求 example.com/h
I was just wondering how to perform a redirect from root in Apache.
I want to check if someone goes to the root url (eg. example.com
) and redirect them to example.com/h
automatically.
Can I do this in apache config, or in a .htaccess
file?
解决方案
NameVirtualHost *:80
<VirtualHost *:80>
ServerName example.com
RedirectMatch 301 ^/$ /h
</VirtualHost>
This will help you to redirect all your request from example.com
to example.com/h
这篇关于阿帕奇从根重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文