Last modified: 2010-05-15 15:59:38 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T14838, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12838 - Search field fails when rewrite rules don't pass through parameters
Search field fails when rewrite rules don't pass through parameters
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Search (Other open bugs)
1.11.x
All All
: Normal critical (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-30 09:04 UTC by Hannes
Modified: 2010-05-15 15:59 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Hannes 2008-01-30 09:04:10 UTC
On my Mediawiki install using the Search form (either "Go" or "Search") fails.
Instead of a search result I get a 
"No such special page
You have requested an invalid special page."
If I enter myhost.com/wiki/Special:Search I do get to the search page and can do the search.
Also, if I change the URL from "myhost.com/wiki/Special:Search?search=foo&fulltext=Search" to "/wiki/Special:Search?foo=bar&search=foo&fulltext=Search" then I get results. If the first GET variable is "search" then the URL fails.

This lead me to believe that my Short URL's might be configured wrongly. I use Lighttpd with the following rewrite-rules (picked from the Manual:Short URL page:
url.rewrite-once = (
        "(^/wiki/[^:]*[\./].*)" => "$1",
        "^/wiki/([^?]*)(?:\?(.*))?" => "/w/index.php?title=$1$2",
        "^/wiki/" => "/w/index.php",
)

The wiki is installed to directory "w".
Comment 1 Brion Vibber 2008-02-02 00:39:13 UTC
Sounds like some problem with your rewrite rules, yes.
Comment 2 Brion Vibber 2008-03-19 00:24:22 UTC
It's somewhat undecided whether we want to support this sort of configuration... some would prefer to more aggressively put parameters after $wgArticlePath/$wgActionPaths-style links.
Comment 3 Rowan Rodrik van der Molen 2008-03-22 02:40:43 UTC
I'm not very familiar with Lighttpd, but if I see it right, you make a mistake in your second rewrite rule. You add the query string (the part after the '?' char) to the title, but this will rewrite to (using your example) /w/index.php?title=Special:Searchsearch=foo&fulltext=Search
Clearly, you want to add an ampersand between $1 and $2, but that would also add an unnecessary ampersand if you have an empty query string. I would simply add an extra rule so that you have one for queries WITH query string and one for queries WITHOUT query string.

With Apache's mod_rewrite, I can simply use the qsappend flag to copy the query string over automatically. Doesn't Lighttpd have something similar? In mod_rewrite, this flag will even figure out if it has to use ? or & before the query string.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links