使用301重定向的httpd.conf [英] 301 redirect using httpd.conf

查看:139
本文介绍了使用301重定向的httpd.conf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读的地方,使用的.htaccess的301重定向,不建议和一个更好的做法将是使用的httpd.conf

  1. 是真的吗?为什么?
  2. 我们可以使用正则表达式在httpd.conf - 相同的,因为我们做的.htaccess?
解决方案

好了,一般来说的.htaccess只​​是意味着每个目录设置和httpd.conf中服务器级设置。同时访问的.htaccess 文件增加了一些小的开销,但是这可能不是你的问题。

是的,你可以使用常规的前pressions在httpd.conf

I read somewhere that using .htaccess for 301 redirect is not recommended and that a better practice will be to use httpd.conf

  1. is that true ? why ?
  2. can we use regexp in httpd.conf - the same as we do with .htaccess ?

解决方案

Well, generally speaking .htaccess is just meant for per-directory settings and the httpd.conf for server wide settings. Also accessing the .htaccess file adds some small overhead but that's probably not your concern.

And yes, you can use regular expressions in the httpd.conf

这篇关于使用301重定向的httpd.conf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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