Skip to content
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

old ?query= parameter ignored/failing #78

Closed
anarcat opened this issue Apr 21, 2017 · 4 comments
Closed

old ?query= parameter ignored/failing #78

anarcat opened this issue Apr 21, 2017 · 4 comments

Comments

@anarcat
Copy link
Contributor

anarcat commented Apr 21, 2017

I have found links in the wild (in my own blog, namely) that point to ?query=man-style URLs. An example I had was:

https://manpages.debian.org/?query=dh-make

Those do not work anymore: they just show the homepage.

Now, maybe that never worked, but I'm pretty confident it did. Do we want to support old URLs like this?

@stapelberg
Copy link
Contributor

In general, yes, old URLs should be supported if that’s easy. The redirects are configured at https://anonscm.debian.org/git/mirror/dsa-puppet.git/tree/modules/roles/templates/static-mirroring/vhost/manpages.debian.org.erb#n26

@anarcat
Copy link
Contributor Author

anarcat commented Apr 22, 2017

Looks like this could be expanded by removing the condition?

	# Redirect old CGI paths, keeping at least the manpage (the other
	# parameters are left out for simplicity).
	RewriteCond %{QUERY_STRING} ^$
	RewriteRule ^/cgi-bin/man.cgi$ / [redirect=301,last]
	RewriteCond %{QUERY_STRING} (?:.*(?:^|&))query=([^&]+)
	RewriteRule ^/cgi-bin/man.cgi /%1 [redirect=307,qsdiscard,last]

... not sure.

@stapelberg
Copy link
Contributor

Inserting the following lines above line 16 works in my local tests:

	RewriteCond %{QUERY_STRING} (?:.*(?:^|&))query=([^&]+)
	RewriteRule ^/?$ /%1 [redirect=307,qsdiscard,last]

I’ll ask DSA to pull my config change.

@stapelberg
Copy link
Contributor

Forgot to follow up on this issue, but the changes were merged two weeks ago and the syntax actually works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants