admin管理员组文章数量:1432566
I'm encountering a 301 problem from my pre-production site which is automatically redirected to my production site. I know the problem comes from WP because I already launched a curl in order to see responses either :
1) targeting the WP pre-production-site :
> GET / HTTP/1.1
> Host: www.pre-production-site
> User-Agent: curl/7.53.1
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Tue, 07 Mar 2017 11:51:19 GMT
< Server: Apache/2.2.22
< Location: /
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: sameorigin
< Vary: Accept-Encoding
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
<
* Connection #0 to host www.pre-production-site left intact
2) targeting my own .php file uploaded on the pre-production-site :
> GET /up.php HTTP/1.1
> Host: www.pre-production-site
> User-Agent: curl/7.53.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 07 Mar 2017 11:54:29 GMT
< Server: Apache/2.2.22
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: sameorigin
< Vary: Accept-Encoding
< Content-Length: 2
< Content-Type: text/html; charset=UTF-8
<
42* Connection #0 to host www.pre-production-site left intact
I don't understand because I've already checked :
- .htaccess file : doesn't contain any kind of redirection
- Apache configuration files : seems OK too
- source code (if a plugin would sets a Location: header) with a recursive grep : didn't find anything
Where is set this 301 ? I'm not sure if I left all informations that you need so feel free to ask me !
Thank you very much for your help !
I'm encountering a 301 problem from my pre-production site which is automatically redirected to my production site. I know the problem comes from WP because I already launched a curl in order to see responses either :
1) targeting the WP pre-production-site :
> GET / HTTP/1.1
> Host: www.pre-production-site
> User-Agent: curl/7.53.1
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Tue, 07 Mar 2017 11:51:19 GMT
< Server: Apache/2.2.22
< Location: http://www.production-site/
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: sameorigin
< Vary: Accept-Encoding
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
<
* Connection #0 to host www.pre-production-site left intact
2) targeting my own .php file uploaded on the pre-production-site :
> GET /up.php HTTP/1.1
> Host: www.pre-production-site
> User-Agent: curl/7.53.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 07 Mar 2017 11:54:29 GMT
< Server: Apache/2.2.22
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: sameorigin
< Vary: Accept-Encoding
< Content-Length: 2
< Content-Type: text/html; charset=UTF-8
<
42* Connection #0 to host www.pre-production-site left intact
I don't understand because I've already checked :
- .htaccess file : doesn't contain any kind of redirection
- Apache configuration files : seems OK too
- source code (if a plugin would sets a Location: header) with a recursive grep : didn't find anything
Where is set this 301 ? I'm not sure if I left all informations that you need so feel free to ask me !
Thank you very much for your help !
Share Improve this question edited Mar 7, 2017 at 15:36 Fred Sautot asked Mar 7, 2017 at 13:01 Fred SautotFred Sautot 13 bronze badges2 Answers
Reset to default 1Did you check the 'options' table in your WP databasse for the two instances of the domain name (something like 'http://www.example ' ).
Not clear if your pre-production site is hosted on a local machine, or networked server. Might be some firewall redirection rules causing issues.
Just a little clarification of @RickHellewell's answer:
To prevent Wordpress from redirecting to my live site when I copied the database to my local machine for development work, I updated two rows in the database with the following query:
UPDATE wp_options SET option_value='http://localhost' WHERE option_value='http://mylivesite';
This allowed me to load (and work on) my site locally by visiting http://localhost and http://localhost/wp-admin
本文标签: How to prevent redirect 301
版权声明:本文标题:How to prevent redirect 301 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745607312a2665909.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论