Skip to content

Redirect all 2.7 files removed in Python 3 #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 102 additions & 3 deletions salt/docs/config/nginx.docs-backend.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,111 @@ server {
}

# Smooth the switch between versions by mapping old files to their new location
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8)/library/sets.html$ {
return 301 https://$host/$1$2/library/stdtypes.html#set-types-set-frozenset;
}
location ~ ^/([a-z-]*/)?(3|3.6|3.7|3.8)/library/email.util.html$ {
return 301 https://$host/$1$2/library/email.utils.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/c-api/(class|cobject|int|string).html$ {
return 301 https://$host/$1$2/c-api/;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/howto/(doanddont|webservers).html$ {
return 301 https://$host/$1$2/;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return 301 https://$host/$1$2/;
return 301 https://$host/$1$2/howto/;

?

Copy link
Contributor Author

@verhovsky verhovsky Feb 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I clicked on https://docs.python.org/3/howto/webservers.html I (probably) don't care about other how-to's, I care to know that the link no longer works and I think linking to the homepage of the docs is better for that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right.

}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/(aepack|aetools|aetypes|al|autogil|bastion|bsddb|carbon|cd|colorpicker|commands|compiler|dbhash|dircache|dl|dummy_thread|easydialogs|fl|fm|fpectl|fpformat|framework|future_builtins|gensuitemodule|gl|hotshot|htmllib|ic|imageop|imgfile|imputil|jpeg|mac|macos|macosa|macostools|macpath|md5|mhlib|mimetools|mimewriter|mimify|miniaeframe|multifile|mutex|new|popen2|posixfile|restricted|rexec|rfc822|sgi|sgmllib|sha|someos|statvfs|sun|sunaudio|user).html$ {
return 301 https://$host/$1$2/;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/strings.html$ {
return 301 https://$host/$1$2/library/text.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/stringio.html$ {
return 301 https://$host/$1$2/library/io.html#io.StringIO;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/sets.html$ {
return 301 https://$host/$1$2/library/stdtypes.html#set-types-set-frozenset;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/userdict.html$ {
return 301 https://$host/$1$2/library/collections.html#userdict-objects;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/repr.html$ {
return 301 https://$host/$1$2/library/reprlib.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/copy_reg.html$ {
return 301 https://$host/$1$2/library/copyreg.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/anydbm.html$ {
return 301 https://$host/$1$2/library/dbm.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/whichdb.html$ {
return 301 https://$host/$1$2/library/dbm.html#dbm.whichdb;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/dumbdbm.html$ {
return 301 https://$host/$1$2/library/dbm.html#module-dbm.dumb;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/dbm.html$ {
return 301 https://$host/$1$2/library/dbm.html#module-dbm.ndbm;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/gdbm.html$ {
return 301 https://$host/$1$2/library/dbm.html#module-dbm.gnu;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/robotparser.html$ {
return 301 https://$host/$1$2/library/urllib.robotparser.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/thread.html$ {
return 301 https://$host/$1$2/library/_thread.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/email-examples.html$ {
return 301 https://$host/$1$2/library/email.examples.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/htmlparser.html$ {
return 301 https://$host/$1$2/library/html.parser.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/urllib2.html$ {
return 301 https://$host/$1$2/library/urllib.request.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/httplib.html$ {
return 301 https://$host/$1$2/library/http.client.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/urlparse.html$ {
return 301 https://$host/$1$2/library/urllib.parse.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/basehttpserver.html$ {
return 301 https://$host/$1$2/library/http.server.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/simplehttpserver.html$ {
return 301 https://$host/$1$2/library/http.server.html#http.server.SimpleHTTPRequestHandler;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/cgihttpserver.html$ {
return 301 https://$host/$1$2/library/http.server.html#http.server.CGIHTTPRequestHandler;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/cookielib.html$ {
return 301 https://$host/$1$2/library/http.cookiejar.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/cookie.html$ {
return 301 https://$host/$1$2/library/http.cookies.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/xmlrpclib.html$ {
return 301 https://$host/$1$2/library/xmlrpc.client.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/simplexmlrpcserver.html$ {
return 301 https://$host/$1$2/library/xmlrpc.server.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/docxmlrpcserver.html$ {
return 301 https://$host/$1$2/library/xmlrpc.server.html#documenting-xmlrpc-server;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/ttk.html$ {
return 301 https://$host/$1$2/library/tkinter.ttk.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/tix.html$ {
return 301 https://$host/$1$2/library/tkinter.tix.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/scrolledtext.html$ {
return 301 https://$host/$1$2/library/tkinter.scrolledtext.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/__builtin__.html$ {
return 301 https://$host/$1$2/library/builtins.html;
}
location ~ ^/([a-z-]*/)?(3|3.5|3.6|3.7|3.8|3.9|3.10)/library/_winreg.html$ {
return 301 https://$host/$1$2/library/winreg.html;
}

# Map /documenting to the devguide.
location ~ ^/devguide/(.*)$ {
Expand Down