Navigation Menu

Skip to content

Commit

Permalink
Add a redirect for URLs with & something
Browse files Browse the repository at this point in the history
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:

````
http://www.spaconference.org/cgi-bin/wiki.pl?browse=JuhaPekkaTolvanen&type=bio2
http://www.spaconference.org/cgi-bin/wiki.pl?browse=DavidHarvey
http://www.spaconference.org/mediawiki/index.php?title=User:RachelDavies
http://www.spaconference.org/scripts/people.php?username=NathanielPryce&useskin=bio
http://www.spaconference.org/mediawiki/index.php?title=User:RachelDavies&useskin=bio
http://www.spaconference.org/mediawiki/index.php?title=User:DickGabriel&type=bio
````
  • Loading branch information
annashipman committed Jul 17, 2017
1 parent f15a082 commit 2ad7685
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mediawiki/.htaccess
Expand Up @@ -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]

Expand Down

0 comments on commit 2ad7685

Please sign in to comment.