Browse files

Add a redirect for URLs with `&` something

Some of the URLs have extra query parameters that no longer make sense and range from having no effect, through giving an unstyled page, to returning a 404 when the page is actually there (because the title is not exactly the same).

This rule looks for query strings that have a second parameter and discards it.

Rewrite Conditions are executed in order so this has to be before the one that looks for any characters at all.

Test data, all of which now works:

  • Loading branch information...
annashipman committed Jul 17, 2017
1 parent f15a082 commit 2ad76858abfcfa8eeaf9ae4a971066e33a40c5ba
Showing with 3 additions and 0 deletions.
  1. +3 −0 mediawiki/.htaccess
@@ -13,6 +13,9 @@
CheckSpelling Off

RewriteEngine on
RewriteCond %{QUERY_STRING} (.+)&(.+)
RewriteRule ^(index\.php)$ $1\%3F%1 [L]

RewriteCond %{QUERY_STRING} (.+)
RewriteRule ^(index\.php)$ $1\%3F%1 [L]

0 comments on commit 2ad7685

Please sign in to comment.