A single apostrophe in an Article title on my Wiki is breaking that article.
For example:
An article titled: What's in Season this month
Has the URL: What%27s_in_Season_this_month
When the page loads the title is displayed as: What?s in Season this month
And the page content is replace with the following message:
There is currently no text in this page, you can search for this page title in other pages or edit this page.
Will someone please shed some light on how this can be fixed?
My Wiki installation is as follows:
MediaWiki: 1.10.0 PHP: 5.2.2 (apache2handler) MySQL: 4.1.20
Many thanks in advance, Matthew
Matthew Vickery wrote:
An article titled: What's in Season this month
Has the URL: What%27s_in_Season_this_month
When the page loads the title is displayed as: What?s in Season this month
And the page content is replace with the following message:
There is currently no text in this page, you can search for this page title in other pages or edit this page.
Well, the URL is correct -- %27 is indeed the correct URL-encoding of an apostrophe -- but obviously something is breaking past that point. I presume the "?" in the title isn't an actual question mark but your browser's rendering of an invalid or unrecognized character. On the page you get, there should be an edit link; can you copy the URL that link points to and see what the apostrophe has turned into there?
Thanks Ilmari,
This is the URL of the edit page:
/w/index.php?title=What%3Fs_in_Season_this_month&action=edit
Matthew
On 06/02/2008, Ilmari Karonen nospam@vyznev.net wrote:
Matthew Vickery wrote:
An article titled: What's in Season this month
Has the URL: What%27s_in_Season_this_month
When the page loads the title is displayed as: What?s in Season this month
And the page content is replace with the following message:
There is currently no text in this page, you can search for this page title in other pages or edit this page.
Well, the URL is correct -- %27 is indeed the correct URL-encoding of an apostrophe -- but obviously something is breaking past that point. I presume the "?" in the title isn't an actual question mark but your browser's rendering of an invalid or unrecognized character. On the page you get, there should be an edit link; can you copy the URL that link points to and see what the apostrophe has turned into there?
-- Ilmari Karonen
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
Matthew Vickery wrote:
This is the URL of the edit page:
/w/index.php?title=What%3Fs_in_Season_this_month&action=edit
...so it _is_ a real question mark! Now I'm frankly stumped. All I can think of at this point is checking your Apache configs to see if there's some weird rewrite rule that is replacing apostrophes with question marks. :/
On 2/6/08, Matthew Vickery vickery.matthew@gmail.com wrote:
Thanks Ilmari,
This is the URL of the edit page:
/w/index.php?title=What%3Fs_in_Season_this_month&action=edit
Matthew
Well, for starters, "%3F" is a literal question mark, rather than something your browser doesn't know how to display.
—C.W.
What if you put some text which contains apostrophe in it and save the page? Does the content of the page also gets screwed? Or is this limited to the title (which could mean it has nothing to do with Apache)?
Also, what version of MediaWiki are you using? (Paste it from Special:Version)
Hope I can help Huji
On Feb 6, 2008 7:26 PM, Charlotte Webb charlottethewebb@gmail.com wrote:
On 2/6/08, Matthew Vickery vickery.matthew@gmail.com wrote:
Thanks Ilmari,
This is the URL of the edit page:
/w/index.php?title=What%3Fs_in_Season_this_month&action=edit
Matthew
Well, for starters, "%3F" is a literal question mark, rather than something your browser doesn't know how to display.
—C.W.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
Thanks for your responses. Here are some answers to your questions.
If I create a new page with an apostrophe in the title (e.g. What's_in_Season_this_Month) and some text in the body and save it. When I follow a Wikilink to the page the page is not found and I get the message below and the apostrophe in the page title is converted to a question mark (What?s in Season this Month):
'There is currently no text in this page, you can search for this page title in other pages or edit this page'
The edit link in the message above the brings me to a blank edit screen:
/w/index.php?title=What%3Fs_in_Season_this_Month&action=edit
Where the apostrophe has been replaced with %3F rather than %27
%3F being a question mark and %27 being an apostrophe.
The only way I can access the body of the page is to manually type an edit URL as follows:
/w/index.php?title=What%27s_in_Season_this_Month&action=edit
Here is my .htaccess code:
# Don't show directory listings for URLs which map to a directory. Options All -Indexes
# Force all traffic to use secure connection RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%%7BHTTP_HOST%7D%%7BREQUEST_URI%7D
Hope this will shed some light!
Matthew
On 06/02/2008, Thomas Dalton thomas.dalton@gmail.com wrote:
Also, what version of MediaWiki are you using? (Paste it from Special:Version)
He already said:
"My Wiki installation is as follows:
MediaWiki: 1.10.0 PHP: 5.2.2 (apache2handler) MySQL: 4.1.20"
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
PS: I'm not using .htaccess to create short URLs. Instead I'm using the Alias method as described here:
http://www.mediawiki.org/wiki/Manual:Short_URL/Page_title_--_Aliasing_method...
Matthew
On 07/02/2008, Matthew Vickery vickery.matthew@gmail.com wrote:
Thanks for your responses. Here are some answers to your questions.
If I create a new page with an apostrophe in the title (e.g. What's_in_Season_this_Month) and some text in the body and save it. When I follow a Wikilink to the page the page is not found and I get the message below and the apostrophe in the page title is converted to a question mark (What?s in Season this Month):
'There is currently no text in this page, you can search for this page title in other pages or edit this page'
The edit link in the message above the brings me to a blank edit screen:
/w/index.php?title=What%3Fs_in_Season_this_Month&action=edit
Where the apostrophe has been replaced with %3F rather than %27
%3F being a question mark and %27 being an apostrophe.
The only way I can access the body of the page is to manually type an edit URL as follows:
/w/index.php?title=What%27s_in_Season_this_Month&action=edit
Here is my .htaccess code:
# Don't show directory listings for URLs which map to a directory. Options All -Indexes
# Force all traffic to use secure connection RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%%7BHTTP_HOST%7D%%7BREQUEST_URI%7D
Hope this will shed some light!
Matthew
On 06/02/2008, Thomas Dalton thomas.dalton@gmail.com wrote:
Also, what version of MediaWiki are you using? (Paste it from Special:Version)
He already said:
"My Wiki installation is as follows:
MediaWiki: 1.10.0 PHP: 5.2.2 (apache2handler) MySQL: 4.1.20"
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
You still didn't tell what happens if you put an apostrophe in the "content" of the page and save it. Does that also change to a question mark?
On Feb 7, 2008 7:55 PM, Matthew Vickery vickery.matthew@gmail.com wrote:
Thanks for your responses. Here are some answers to your questions.
If I create a new page with an apostrophe in the title (e.g. What's_in_Season_this_Month) and some text in the body and save it. When I follow a Wikilink to the page the page is not found and I get the message below and the apostrophe in the page title is converted to a question mark (What?s in Season this Month):
'There is currently no text in this page, you can search for this page title in other pages or edit this page'
The edit link in the message above the brings me to a blank edit screen:
/w/index.php?title=What%3Fs_in_Season_this_Month&action=edit
Where the apostrophe has been replaced with %3F rather than %27
%3F being a question mark and %27 being an apostrophe.
The only way I can access the body of the page is to manually type an edit URL as follows:
/w/index.php?title=What%27s_in_Season_this_Month&action=edit
Here is my .htaccess code:
# Don't show directory listings for URLs which map to a directory. Options All -Indexes
# Force all traffic to use secure connection RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%%7BHTTP_HOST%7D%%7BREQUEST_URI%7D
Hope this will shed some light!
Matthew
On 06/02/2008, Thomas Dalton thomas.dalton@gmail.com wrote:
Also, what version of MediaWiki are you using? (Paste it from Special:Version)
He already said:
"My Wiki installation is as follows:
MediaWiki: 1.10.0 PHP: 5.2.2 (apache2handler) MySQL: 4.1.20"
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
Sorry Huji, An apostrophe in the "content" of the page appears correctly as an apostrophe both before and after the page has been saved.
Hope this helps?
Matthew
On 07/02/2008, Huji huji.huji@gmail.com wrote:
You still didn't tell what happens if you put an apostrophe in the "content" of the page and save it. Does that also change to a question mark?
On Feb 7, 2008 7:55 PM, Matthew Vickery vickery.matthew@gmail.com wrote:
Thanks for your responses. Here are some answers to your questions.
If I create a new page with an apostrophe in the title (e.g. What's_in_Season_this_Month) and some text in the body and save it. When I follow a Wikilink to the page the page is not found and I get the message below and the apostrophe in the page title is converted to a question mark (What?s in Season this Month):
'There is currently no text in this page, you can search for this page title in other pages or edit this page'
The edit link in the message above the brings me to a blank edit screen:
/w/index.php?title=What%3Fs_in_Season_this_Month&action=edit
Where the apostrophe has been replaced with %3F rather than %27
%3F being a question mark and %27 being an apostrophe.
The only way I can access the body of the page is to manually type an edit URL as follows:
/w/index.php?title=What%27s_in_Season_this_Month&action=edit
Here is my .htaccess code:
# Don't show directory listings for URLs which map to a directory. Options All -Indexes
# Force all traffic to use secure connection RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%%7BHTTP_HOST%7D%%7BREQUEST_URI%7D
Hope this will shed some light!
Matthew
On 06/02/2008, Thomas Dalton thomas.dalton@gmail.com wrote:
Also, what version of MediaWiki are you using? (Paste it from Special:Version)
He already said:
"My Wiki installation is as follows:
MediaWiki: 1.10.0 PHP: 5.2.2 (apache2handler) MySQL: 4.1.20"
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
Then the first place to look into is the short URL algorithm. It is not a MediaWiki bug I guess, and not one of Apache or PHP (because the page content is not touched). It only happens to the URL, so it is probably related to the URL rewriting. I'm not good in Apache rewrites; maybe someone else can help you with that.
Huji
On Feb 7, 2008 10:31 PM, Matthew Vickery vickery.matthew@gmail.com wrote:
Sorry Huji, An apostrophe in the "content" of the page appears correctly as an apostrophe both before and after the page has been saved.
Hope this helps?
Matthew
On 07/02/2008, Huji huji.huji@gmail.com wrote:
You still didn't tell what happens if you put an apostrophe in the
"content"
of the page and save it. Does that also change to a question mark?
On Feb 7, 2008 7:55 PM, Matthew Vickery vickery.matthew@gmail.com
wrote:
Thanks for your responses. Here are some answers to your questions.
If I create a new page with an apostrophe in the title (e.g. What's_in_Season_this_Month) and some text in the body and save it. When I follow a Wikilink to the page the page is not found and I get the message below and the apostrophe in the page title is converted to a question mark (What?s in Season this Month):
'There is currently no text in this page, you can search for this page title in other pages or edit this page'
The edit link in the message above the brings me to a blank edit
screen:
/w/index.php?title=What%3Fs_in_Season_this_Month&action=edit
Where the apostrophe has been replaced with %3F rather than %27
%3F being a question mark and %27 being an apostrophe.
The only way I can access the body of the page is to manually type an edit URL as follows:
/w/index.php?title=What%27s_in_Season_this_Month&action=edit
Here is my .htaccess code:
# Don't show directory listings for URLs which map to a directory. Options All -Indexes
# Force all traffic to use secure connection RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%%7BHTTP_HOST%7D%%7BREQUEST_URI%7D
Hope this will shed some light!
Matthew
On 06/02/2008, Thomas Dalton thomas.dalton@gmail.com wrote:
Also, what version of MediaWiki are you using? (Paste it from Special:Version)
He already said:
"My Wiki installation is as follows:
MediaWiki: 1.10.0 PHP: 5.2.2 (apache2handler) MySQL: 4.1.20"
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Thanks Huji!
When I remove all URL shortening as per Huji's advice the problem goes away. However I would like short URLs and so need to fix my this. Now the problem has been isolate how do I fix it?
I've gone over my code again and as far as I can see everything is as described in this article: http://www.mediawiki.org/wiki/Manual:Short_URL#Guide
Here is my .htaccess, vhost_ssl.conf and LocalSettings.php code:
.htaccess: # Don't show directory listings for URLs which map to a directory. Options All -Indexes
# Force all traffic to use secure connection RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%%7BHTTP_HOST%7D%%7BREQUEST_URI%7D
vhost_ssl.conf: # MediaWiki Short URL Aliases #These must come last, and in this order! Alias /brandstandards /var/www/vhosts/domain.com/httpdocs/bs/index.php Alias /wiki /var/www/vhosts/domain.com/httpdocs/w/index.php Alias /index.php /var/www/vhosts/domain.com/httpdocs/w/index.php (There are two Wikis on the domain but that's not the cause of the problem)
LocalSettings.php: ## The URL base path to the directory containing the wiki; ## defaults for all runtime URL paths are based off of this. $wgScriptPath = "/w"; $wgScript = "$wgScriptPath/index.php"; $wgRedirectScript = "$wgScriptPath/redirect.php";
$wgArticlePath = "/wiki/$1"; $wgUsePathInfo = true;
$wgStylePath = "$wgScriptPath/skins"; $wgStyleDirectory = "$IP/skins"; $wgLogo = "$wgStylePath/common/images/logo.png";
$wgUploadPath = "$wgScriptPath/img_auth.php";
On 08/02/2008, Huji huji.huji@gmail.com wrote:
Then the first place to look into is the short URL algorithm. It is not a MediaWiki bug I guess, and not one of Apache or PHP (because the page content is not touched). It only happens to the URL, so it is probably related to the URL rewriting. I'm not good in Apache rewrites; maybe someone else can help you with that.
Huji
On Feb 7, 2008 10:31 PM, Matthew Vickery vickery.matthew@gmail.com wrote:
Sorry Huji, An apostrophe in the "content" of the page appears correctly as an apostrophe both before and after the page has been saved.
Hope this helps?
Matthew
On 07/02/2008, Huji huji.huji@gmail.com wrote:
You still didn't tell what happens if you put an apostrophe in the
"content"
of the page and save it. Does that also change to a question mark?
On Feb 7, 2008 7:55 PM, Matthew Vickery vickery.matthew@gmail.com
wrote:
Thanks for your responses. Here are some answers to your questions.
If I create a new page with an apostrophe in the title (e.g. What's_in_Season_this_Month) and some text in the body and save it. When I follow a Wikilink to the page the page is not found and I get the message below and the apostrophe in the page title is converted to a question mark (What?s in Season this Month):
'There is currently no text in this page, you can search for this page title in other pages or edit this page'
The edit link in the message above the brings me to a blank edit
screen:
/w/index.php?title=What%3Fs_in_Season_this_Month&action=edit
Where the apostrophe has been replaced with %3F rather than %27
%3F being a question mark and %27 being an apostrophe.
The only way I can access the body of the page is to manually type an edit URL as follows:
/w/index.php?title=What%27s_in_Season_this_Month&action=edit
Here is my .htaccess code:
# Don't show directory listings for URLs which map to a directory. Options All -Indexes
# Force all traffic to use secure connection RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%%7BHTTP_HOST%7D%%7BREQUEST_URI%7D
Hope this will shed some light!
Matthew
On 06/02/2008, Thomas Dalton thomas.dalton@gmail.com wrote:
Also, what version of MediaWiki are you using? (Paste it from Special:Version)
He already said:
"My Wiki installation is as follows:
MediaWiki: 1.10.0 PHP: 5.2.2 (apache2handler) MySQL: 4.1.20"
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Matthew Vickery wrote:
.htaccess: # Don't show directory listings for URLs which map to a directory. Options All -Indexes
# Force all traffic to use secure connection RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%%7BHTTP_HOST%7D%%7BREQUEST_URI%7D
vhost_ssl.conf: # MediaWiki Short URL Aliases #These must come last, and in this order! Alias /brandstandards /var/www/vhosts/domain.com/httpdocs/bs/index.php Alias /wiki /var/www/vhosts/domain.com/httpdocs/w/index.php Alias /index.php /var/www/vhosts/domain.com/httpdocs/w/index.php (There are two Wikis on the domain but that's not the cause of the problem)
Hmm... since you're already using mod_rewrite for the secure connection stuff, why not try using it instead of Alias for the short URLs too? Something like:
RewriteRule ^wiki(/.*)?$ /w/index.php$1 [L,NS,QSA]
ought to do it.
Ilmari Karonen wrote:
Hmm... since you're already using mod_rewrite for the secure connection stuff, why not try using it instead of Alias for the short URLs too? Something like:
RewriteRule ^wiki(/.*)?$ /w/index.php$1 [L,NS,QSA]
ought to do it.
...although, come to think of it, it might be even better to try it like this:
RewriteRule ^wiki(/(.*))?$ /w/index.php?title=$2 [L,NS,QSA]
That way, you'll avoid passing title via PATH_INFO, and any character mangling issues that might cause. (Both work just fine for me, but your Apache installation might be different. The comments in DefaultSettings.php do warn about possible problems with path info, so it might be worth checking.)
Thanks for your posts Ilmari :)
I've added the rewrite code form the following link to my .htaccess file: http://www.mediawiki.org/wiki/Manual:Short_URL/wiki/Page_title_--_no_root_ac...
Do you think I need to add the extra parentheses you added in your last post Ilmari to my .htaccess?
Will mod_rewrite in .htaccess use more server resources than mod_alias in http.conf would? I guess my original problem was caused by some strange Apache server configuration? Does anyone have any idea what this might have been?
Matthew
On 08/02/2008, Ilmari Karonen nospam@vyznev.net wrote:
Ilmari Karonen wrote:
Hmm... since you're already using mod_rewrite for the secure connection stuff, why not try using it instead of Alias for the short URLs too? Something like:
RewriteRule ^wiki(/.*)?$ /w/index.php$1 [L,NS,QSA]
ought to do it.
...although, come to think of it, it might be even better to try it like this:
RewriteRule ^wiki(/(.*))?$ /w/index.php?title=$2 [L,NS,QSA]
That way, you'll avoid passing title via PATH_INFO, and any character mangling issues that might cause. (Both work just fine for me, but your Apache installation might be different. The comments in DefaultSettings.php do warn about possible problems with path info, so it might be worth checking.)
-- Ilmari Karonen
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Matthew Vickery wrote:
Thanks for your posts Ilmari :)
I've added the rewrite code form the following link to my .htaccess file: http://www.mediawiki.org/wiki/Manual:Short_URL/wiki/Page_title_--_no_root_ac...
Do you think I need to add the extra parentheses you added in your last post Ilmari to my .htaccess?
Those are there only to allow "/wiki" without the trailing slash to be redirected appropriately; if you don't need that feature, or have a separate rewrite rule for that, then you don't need them.
Will mod_rewrite in .htaccess use more server resources than mod_alias in http.conf would?
Probably, but you could put the mod_rewrite rules in your http.conf. That should make it about as fast as mod_alias would be.
On Feb 8, 2008 2:39 PM, Matthew Vickery vickery.matthew@gmail.com wrote:
Thanks Huji!
When I remove all URL shortening as per Huji's advice the problem goes away. However I would like short URLs and so need to fix my this. Now the problem has been isolate how do I fix it?
Glad to be of assistance! :D
~~~~ (aka Huji!)
wikitech-l@lists.wikimedia.org