301 redirection
-
我用word press 4.9.1建立了一个测试页面,遇到如下问题:
1、当setting里的wordpress地址和站点地址配置如下时:
http://139.159.226.85/wordpress
使用如下命令:
curl -1 -H ‘Host: 192.168.0.110’ http://192.168.0.110/wordpress/
(192.168.0.110是139.159.226.85的内网地址)
可以正常获取响应;
使用
curl -1 -H ‘Host: 192.168.0.110:80’ http://192.168.0.110/wordpress/
则会返回301,并指向:http://192.168.0.110/wordpress
2、当setting里的wordpress地址和站点地址配置如下时:
http://139.159.226.85:80/wordpress
使用如下命令:
curl -1 -H ‘Host: 192.168.0.110:80’ http://192.168.0.110/wordpress/
可以正常获取响应;
使用
curl -1 -H ‘Host: 192.168.0.110’ http://192.168.0.110/wordpress/
则会返回301,并指向:http://192.168.0.110:80/wordpress因为不同的客户端在提交http请求时可能在header里host携带端口号,也可能不携带,所以需要wordpress同时支持两种host,请问这个怎么实现?
- 话题 ‘301 redirection’不再接受新回复。