httpd服务安装以及常见问题

来源:互联网 发布:王千源 知乎 编辑:程序博客网 时间:2024/06/11 18:39

常见问题1. 301重定向
修改httpd配置文件httpd.conf。
修改需要重定向的目录,如:

<Directory "/var/www">    AllowOverride All    # Allow open access:    Require all granted</Directory>

即将AllowOveride 由None改为All
配置重定向的具体url

<IfModule alias_module>    #    # Redirect: Allows you to tell clients about documents that used to     # exist in your server's namespace, but do not anymore. The client     # will make a new request for the document at its new location.    # Example:     Redirect 301 /  http://59.111.123.123

填一下状态码、原路径、目的url
重启httpd服务即可。

0 0
原创粉丝点击