By IIPPs
Hi,Guys
I encountered a puzzling Feed error:
I try to set old.com 301 jump to new.com.
Then I found “old.com/?feed=rss2” not jump to the “new.com/feed/” this address. Access “old.com/?feed=rss2” it jumps to new.com Home here.
This is where the problem? How do I solve it? Thanks!
I am using Nginx+Varnish:
server {
listen 127.0.0.1:8080;
server_name old.com http://www.old.com;
return 301 http://www.new.com$request_uri;
}
server {
listen 127.0.0.1:8080;
server_name new.com http://www.new.com;
limit_conn one 20;
limit_rate 200k;
root /var/www/site;
index index.php index.html;
port_in_redirect off;
server_tokens off;
# Only allow these request methods
# Do not accept DELETE, SEARCH and other methods
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 444;
}
# Deny certain Referers
if ( $http_referer ~* (babes|forsale|girl|jewelry|love|nudit|organic|poker|porn|sex|teen|nike|fat|golf|briefcase|education|webcam|zippo|hostgator|slaklyfreelay|outlook|seo) )
{
return 404;
return 403;
}
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
In order to retain the query parameters when using a 301 redirect, you could use:
server {
listen 127.0.0.1:8080;
server_name old.com http://www.old.com;
return 301 http://new.domain-name.com$request_uri?$query_string;
}
Without the $query_string the query parameters (e.g. ?feed=rss2) will be dropped.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.