<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://htyp.org/mw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=64.110.252.116</id>
	<title>HTYP - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://htyp.org/mw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=64.110.252.116"/>
	<link rel="alternate" type="text/html" href="https://htyp.org/Special:Contributions/64.110.252.116"/>
	<updated>2026-06-25T08:01:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://htyp.org/mw/index.php?title=MediaWiki/archive/customizing/URLs&amp;diff=3359</id>
		<title>MediaWiki/archive/customizing/URLs</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=MediaWiki/archive/customizing/URLs&amp;diff=3359"/>
		<updated>2006-02-24T00:40:01Z</updated>

		<summary type="html">&lt;p&gt;64.110.252.116: /* Using a 403 [forbidden] Handler */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{web software|MediaWiki}}: [[MediaWiki Customization|Customization]]: [[Shortening MediaWiki URLs]]&lt;br /&gt;
&lt;br /&gt;
There are (at least) two &amp;quot;standard&amp;quot; ways of prettifying MediaWiki URLs, documented [http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url here]. One uses Apache&#039;s mod_rewrite. Although it probably works well (I haven&#039;t tried it), it just seemed aesthetically unappealing, from a design point of view.&lt;br /&gt;
&lt;br /&gt;
There&#039;s also another way of doing it if you have access to httpd.conf or .htaccess. It&#039;s fairly tidy and quite flexible, though I don&#039;t know how much additional load it puts on the server (see brief discussion at the end).&lt;br /&gt;
==Using a 404 Handler==&lt;br /&gt;
It uses the 404 (missing page) redirect mechanism &amp;amp;mdash; a standard /index.php/ request is handled by the standard code (in index.php), but any other URL which doesn&#039;t correspond to an existing page (within the wiki or not) is handled by a modified index.php. For any given &amp;quot;nonexistent&amp;quot; URL of the form &amp;quot;http://yourdomain.com/nonexistent/page&amp;quot;, the code returns a wiki page entitled &amp;quot;Nonexistent/page&amp;quot;, with the &amp;quot;nonexistent&amp;quot; URL displayed as the URL for that page.&lt;br /&gt;
&lt;br /&gt;
There is also a feature wherein you can create a page called [[Mediawiki:your/url/here]] and it will redirect to an article whose title is the &#039;&#039;contents&#039;&#039; of that page. For example: http://wiki.vbz.net/Currentevents is redirected to [[vbzwiki:Current events]] because the page [[vbzwiki:MediaWiki:Currentevents]] contains the text &amp;quot;Current events&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First&#039;&#039;&#039;, in the main [[.htaccess]] file (or in httpd.conf if you prefer), assign a location to handle 404 errors such that a PHP file will be loaded -- either of these will do, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ErrorDocument 404 /errors/404/&lt;br /&gt;
ErrorDocument 404 /wiki404error.php&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the first instance, your modified index.php file would go in /errors/404/; in the second, it would be renamed wiki4040error.php and go in the same folder as the normal index.php.&lt;br /&gt;
&lt;br /&gt;
The remaining instructions depend on which MediaWiki version you are using.&lt;br /&gt;
===Version 1.4===&lt;br /&gt;
&#039;&#039;These instructions were made from changes that actually worked, but I may have left out some steps. I was more careful when I did the changes for version 1.5, so if these don&#039;t work check the version 1.5 instructions for anything missing.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Second&#039;&#039;&#039;: Make the changes indicated in the 404-handling copy of index.php:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if ( &#039;&#039; == $title &amp;amp;&amp;amp; &#039;delete&#039; != $action ) {&lt;br /&gt;
## 2005-06-19 Woozle mods for &amp;quot;missing&amp;quot; page&lt;br /&gt;
	# title not passed in parameter; use REQUEST_URI from environment&lt;br /&gt;
	$title = rawurldecode(ltrim($_SERVER[&#039;REQUEST_URI&#039;], &amp;quot; /&amp;quot;));&lt;br /&gt;
	# see if there&#039;s a page designated for this URI&lt;br /&gt;
	$wgTitle = Title::newFromText( wfMsgForContent( $title ) );&lt;br /&gt;
	if (&#039;&#039; == $wgTitle) {&lt;br /&gt;
		$wgTitle = Title::newFromText( $title );&lt;br /&gt;
	}&lt;br /&gt;
## end Woozle mods&lt;br /&gt;
} elseif ( $curid = $wgRequest-&amp;gt;getInt( &#039;curid&#039; ) ) {&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	/* redirect to canonical url, make it a 301 to allow caching */&lt;br /&gt;
	$wgOut-&amp;gt;setSquidMaxage( 1200 );&lt;br /&gt;
# 2005-06-21 Woozle mods to allow 404 page to summon wiki page without redirecting&lt;br /&gt;
#	$wgOut-&amp;gt;redirect( $wgTitle-&amp;gt;getFullURL(), &#039;301&#039;);&lt;br /&gt;
	$wgArticle = new Article( $wgTitle );&lt;br /&gt;
#  	$mainText = $wgOut-&amp;gt;parse( $wgArticle-&amp;gt;getContent( false ) );&lt;br /&gt;
#	echo $mainText;&lt;br /&gt;
	$wgArticle-&amp;gt;view();&lt;br /&gt;
# end Woozle mods&lt;br /&gt;
} else if ( Namespace::getSpecial() == $wgTitle-&amp;gt;getNamespace() ) {&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Version 1.5===&lt;br /&gt;
&#039;&#039;&#039;Second&#039;&#039;&#039;: In the same folder as the modified index.php, create a LocalSettings.php with the following contents:&lt;br /&gt;
 &amp;lt;?php&lt;br /&gt;
 require_once( &amp;quot;../../LocalSettings.php&amp;quot; );&lt;br /&gt;
 &lt;br /&gt;
 $wgScript           = $wgScriptPath;&lt;br /&gt;
 $wgArticlePath      = &amp;quot;$wgScript/$1&amp;quot;;&lt;br /&gt;
 ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: &amp;quot;../../LocalSettings.php&amp;quot; works if your modified index.php is buried two folders deep from your main index.php (as in the /errors/404/index.php example); adjust it as needed to point to your main LocalSettings.php.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Third&#039;&#039;&#039;: Make the changes indicated in the 404-handling copy of index.php:&lt;br /&gt;
&lt;br /&gt;
* First change - need to point to the copied Defines.php:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# 2005-10-25 Woozle - for 404 handling&lt;br /&gt;
require_once( &#039;./Defines.php&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Second change - this is optional, but it cleans up the file a lot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# 2005-10-25 Woozle - config code removed because it will never be executed&lt;br /&gt;
#if( !file_exists( &#039;LocalSettings.php&#039; ) ) {&lt;br /&gt;
# ...&lt;br /&gt;
#}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Third change - this pulls in the title-request from the error URI:&lt;br /&gt;
 # Query string fields&lt;br /&gt;
 # 2005-10-25 Woozle - 404 support - parameters have to be parsed from $_SERVER instead of $_REQUEST&lt;br /&gt;
 	$raw_uri = rawurldecode(ltrim($_SERVER[&#039;REQUEST_URI&#039;], &amp;quot; /&amp;quot;));&lt;br /&gt;
 	$arr_uri = explode(&#039;?&#039;,$raw_uri);&lt;br /&gt;
 	$title = $arr_uri[0];&lt;br /&gt;
 	$uri_qry= $arr_uri[1];&lt;br /&gt;
 	parse_str($uri_qry,$_REQUEST);&lt;br /&gt;
 	$action = $wgRequest-&amp;gt;getVal( &#039;action&#039;, &#039;view&#039; );&lt;br /&gt;
 	$title_force = $wgRequest-&amp;gt;getVal( &#039;title&#039; );&lt;br /&gt;
 	if (&#039;&#039; != $title_force) {&lt;br /&gt;
 		$title = $title_force;&lt;br /&gt;
 	}&lt;br /&gt;
 # 2005-10-25 END&lt;br /&gt;
&lt;br /&gt;
* Fourth change - optional and untested - allow title redirection&lt;br /&gt;
 if ( &#039;&#039; == $title &amp;amp;&amp;amp; &#039;delete&#039; != $action ) {&lt;br /&gt;
 	$wgTitle = Title::newFromText( wfMsgForContent( &#039;mainpage&#039; ) );&lt;br /&gt;
 # 2005-10-26 Woozle - 404 support - optional redirect based on &amp;quot;mediawiki:articlename&amp;quot;&lt;br /&gt;
 	if (&#039;&#039; == $wgTitle) {&lt;br /&gt;
 		$wgTitle = Title::newFromText( $title );&lt;br /&gt;
 	}&lt;br /&gt;
 # 2005-10-26 END&lt;br /&gt;
&lt;br /&gt;
* Fifth change - I&#039;m actually not sure if this is necessary, but don&#039;t have time to test uncommenting it:&lt;br /&gt;
 # 2005-10-25 Woozle - for 404 handling - block out redirection code&lt;br /&gt;
 # was -- if ((action is explicitly &amp;quot;view&amp;quot;) AND (title is not passed as param) OR (title is not in canonical form) AND ??&lt;br /&gt;
 #} else if ( ( $action == &#039;view&#039; ) &amp;amp;&amp;amp; 	(!isset( $_GET[&#039;title&#039;] ) || $wgTitle-&amp;gt;getPrefixedDBKey() != $_GET[&#039;title&#039;] ) &amp;amp;&amp;amp; !count( array_diff( array_keys( $_GET ), array( &#039;action&#039;, &#039;title&#039; ) ) ) )&lt;br /&gt;
 #{&lt;br /&gt;
 #	/* redirect to canonical url, make it a 301 to allow caching */&lt;br /&gt;
 #	$wgOut-&amp;gt;setSquidMaxage( 1200 );&lt;br /&gt;
 #	$wgOut-&amp;gt;redirect( $wgTitle-&amp;gt;getFullURL(), &#039;301&#039;);&lt;br /&gt;
 } else if ( NS_SPECIAL == $wgTitle-&amp;gt;getNamespace() ) {&lt;br /&gt;
===Finally===&lt;br /&gt;
Finally, put the modified index.php where it will be the page used to handle 404 errors.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Caveats&#039;&#039;&#039;:&lt;br /&gt;
** Your arbitrary URL will have its first character capitalized before it is displayed as the page&#039;s title or used to load another page (if you have set up a Mediawiki: page for it), although the URL shown will remain unchanged&lt;br /&gt;
** There is probably a lot of excess index.php code which can be stripped out, as it will never be executed in this context&lt;br /&gt;
** URLs ending in slashes appear to be a problem for some namespaces; the wiki code appears to be reading the URL from some place other than the modified code. (This doesn&#039;t seem to be a problem for version 1.5.)&lt;br /&gt;
** &amp;lt;s&amp;gt;All wiki links on the loaded page will point back to canonical wiki URLs, e.g. http://htyp.org/wiki/index.php/Main_Page; to change this. see &amp;quot;Shortening the links&amp;quot; below.&amp;lt;/s&amp;gt; 2006-02-16 This has been fixed.&lt;br /&gt;
** &amp;lt;s&amp;gt;Image thumbnail links don&#039;t work.&amp;lt;/s&amp;gt; 2006-02-16  This has been fixed.&lt;br /&gt;
* &#039;&#039;&#039;2006-02-16&#039;&#039;&#039; Notes:&lt;br /&gt;
** I changed the procedure a bit and page viewing now seems to work consistently, but I&#039;ve only checked a few pages for proper behavior. Please test thoroughly before using on a production page, and let me know what you find.&lt;br /&gt;
** &#039;&#039;&#039;Editing does not work properly&#039;&#039;&#039;&lt;br /&gt;
** If certain pages persist in showing old-style links, they may be cached; add &amp;quot;?action=purge&amp;quot; to the URL to clear the cache for a given page. If you are working on an active site using the old-style links, some pages may mysteriously revert to old-style links as visitors browse them through the old-style portal, causing the old-style to be re-cached.&lt;br /&gt;
** This method is probably not very compatible with most webstats generators, but I haven&#039;t tried it long enough to see what happens. Probably all pages will be logged as 404 errors, which isn&#039;t terribly useful.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note about CPU load&#039;&#039;&#039;: Obviously it has to do the same URL translation it would normally have to do and then determine that the file doesn&#039;t exist, but that shouldn&#039;t take any more cycles than locating an existing file; for URLs containing at least one slash, it should be quicker. Given all the processing done by the MediaWiki software for loading &amp;quot;normal&amp;quot; wiki pages, I suspect the difference is negligible.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
Please feel free to post comments here or on the Talk page if you try any of these procedures.&lt;br /&gt;
&lt;br /&gt;
===Using a 403 [forbidden] Handler===&lt;br /&gt;
Something I have found to work very well, is to force all files except index.php to &amp;quot;Deny from All&amp;quot; and use a 403 error handler to push all requests to index.php&lt;br /&gt;
&lt;br /&gt;
An example .htaccess:&lt;br /&gt;
 Deny from All&lt;br /&gt;
 &amp;lt;Files &amp;quot;index.php&amp;quot;&amp;gt;&lt;br /&gt;
    Allow from All&lt;br /&gt;
 &amp;lt;/Files&amp;gt;&lt;br /&gt;
 # NOTE: DirectoryIndex may not be necessary&lt;br /&gt;
 DirectoryIndex index.php&lt;br /&gt;
 ErrorDocument 403 /index.php&lt;br /&gt;
&lt;br /&gt;
This could probably be shortened up, but I have found it works great. :-) {{anonusersig|64.110.252.116}}&lt;/div&gt;</summary>
		<author><name>64.110.252.116</name></author>
	</entry>
	<entry>
		<id>https://htyp.org/mw/index.php?title=MediaWiki/archive/customizing/URLs&amp;diff=3346</id>
		<title>MediaWiki/archive/customizing/URLs</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=MediaWiki/archive/customizing/URLs&amp;diff=3346"/>
		<updated>2006-02-23T10:06:18Z</updated>

		<summary type="html">&lt;p&gt;64.110.252.116: /* Comments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{web software|MediaWiki}}: [[MediaWiki Customization|Customization]]: [[Shortening MediaWiki URLs]]&lt;br /&gt;
&lt;br /&gt;
There are (at least) two &amp;quot;standard&amp;quot; ways of prettifying MediaWiki URLs, documented [http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url here]. One uses Apache&#039;s mod_rewrite. Although it probably works well (I haven&#039;t tried it), it just seemed aesthetically unappealing, from a design point of view.&lt;br /&gt;
&lt;br /&gt;
There&#039;s also another way of doing it if you have access to httpd.conf or .htaccess. It&#039;s fairly tidy and quite flexible, though I don&#039;t know how much additional load it puts on the server (see brief discussion at the end).&lt;br /&gt;
==Using a 404 Handler==&lt;br /&gt;
It uses the 404 (missing page) redirect mechanism &amp;amp;mdash; a standard /index.php/ request is handled by the standard code (in index.php), but any other URL which doesn&#039;t correspond to an existing page (within the wiki or not) is handled by a modified index.php. For any given &amp;quot;nonexistent&amp;quot; URL of the form &amp;quot;http://yourdomain.com/nonexistent/page&amp;quot;, the code returns a wiki page entitled &amp;quot;Nonexistent/page&amp;quot;, with the &amp;quot;nonexistent&amp;quot; URL displayed as the URL for that page.&lt;br /&gt;
&lt;br /&gt;
There is also a feature wherein you can create a page called [[Mediawiki:your/url/here]] and it will redirect to an article whose title is the &#039;&#039;contents&#039;&#039; of that page. For example: http://wiki.vbz.net/Currentevents is redirected to [[vbzwiki:Current events]] because the page [[vbzwiki:MediaWiki:Currentevents]] contains the text &amp;quot;Current events&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First&#039;&#039;&#039;, in the main [[.htaccess]] file (or in httpd.conf if you prefer), assign a location to handle 404 errors such that a PHP file will be loaded -- either of these will do, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ErrorDocument 404 /errors/404/&lt;br /&gt;
ErrorDocument 404 /wiki404error.php&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the first instance, your modified index.php file would go in /errors/404/; in the second, it would be renamed wiki4040error.php and go in the same folder as the normal index.php.&lt;br /&gt;
&lt;br /&gt;
The remaining instructions depend on which MediaWiki version you are using.&lt;br /&gt;
===Version 1.4===&lt;br /&gt;
&#039;&#039;These instructions were made from changes that actually worked, but I may have left out some steps. I was more careful when I did the changes for version 1.5, so if these don&#039;t work check the version 1.5 instructions for anything missing.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Second&#039;&#039;&#039;: Make the changes indicated in the 404-handling copy of index.php:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if ( &#039;&#039; == $title &amp;amp;&amp;amp; &#039;delete&#039; != $action ) {&lt;br /&gt;
## 2005-06-19 Woozle mods for &amp;quot;missing&amp;quot; page&lt;br /&gt;
	# title not passed in parameter; use REQUEST_URI from environment&lt;br /&gt;
	$title = rawurldecode(ltrim($_SERVER[&#039;REQUEST_URI&#039;], &amp;quot; /&amp;quot;));&lt;br /&gt;
	# see if there&#039;s a page designated for this URI&lt;br /&gt;
	$wgTitle = Title::newFromText( wfMsgForContent( $title ) );&lt;br /&gt;
	if (&#039;&#039; == $wgTitle) {&lt;br /&gt;
		$wgTitle = Title::newFromText( $title );&lt;br /&gt;
	}&lt;br /&gt;
## end Woozle mods&lt;br /&gt;
} elseif ( $curid = $wgRequest-&amp;gt;getInt( &#039;curid&#039; ) ) {&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	/* redirect to canonical url, make it a 301 to allow caching */&lt;br /&gt;
	$wgOut-&amp;gt;setSquidMaxage( 1200 );&lt;br /&gt;
# 2005-06-21 Woozle mods to allow 404 page to summon wiki page without redirecting&lt;br /&gt;
#	$wgOut-&amp;gt;redirect( $wgTitle-&amp;gt;getFullURL(), &#039;301&#039;);&lt;br /&gt;
	$wgArticle = new Article( $wgTitle );&lt;br /&gt;
#  	$mainText = $wgOut-&amp;gt;parse( $wgArticle-&amp;gt;getContent( false ) );&lt;br /&gt;
#	echo $mainText;&lt;br /&gt;
	$wgArticle-&amp;gt;view();&lt;br /&gt;
# end Woozle mods&lt;br /&gt;
} else if ( Namespace::getSpecial() == $wgTitle-&amp;gt;getNamespace() ) {&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Version 1.5===&lt;br /&gt;
&#039;&#039;&#039;Second&#039;&#039;&#039;: In the same folder as the modified index.php, create a LocalSettings.php with the following contents:&lt;br /&gt;
 &amp;lt;?php&lt;br /&gt;
 require_once( &amp;quot;../../LocalSettings.php&amp;quot; );&lt;br /&gt;
 &lt;br /&gt;
 $wgScript           = $wgScriptPath;&lt;br /&gt;
 $wgArticlePath      = &amp;quot;$wgScript/$1&amp;quot;;&lt;br /&gt;
 ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: &amp;quot;../../LocalSettings.php&amp;quot; works if your modified index.php is buried two folders deep from your main index.php (as in the /errors/404/index.php example); adjust it as needed to point to your main LocalSettings.php.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Third&#039;&#039;&#039;: Make the changes indicated in the 404-handling copy of index.php:&lt;br /&gt;
&lt;br /&gt;
* First change - need to point to the copied Defines.php:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# 2005-10-25 Woozle - for 404 handling&lt;br /&gt;
require_once( &#039;./Defines.php&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Second change - this is optional, but it cleans up the file a lot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# 2005-10-25 Woozle - config code removed because it will never be executed&lt;br /&gt;
#if( !file_exists( &#039;LocalSettings.php&#039; ) ) {&lt;br /&gt;
# ...&lt;br /&gt;
#}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Third change - this pulls in the title-request from the error URI:&lt;br /&gt;
 # Query string fields&lt;br /&gt;
 # 2005-10-25 Woozle - 404 support - parameters have to be parsed from $_SERVER instead of $_REQUEST&lt;br /&gt;
 	$raw_uri = rawurldecode(ltrim($_SERVER[&#039;REQUEST_URI&#039;], &amp;quot; /&amp;quot;));&lt;br /&gt;
 	$arr_uri = explode(&#039;?&#039;,$raw_uri);&lt;br /&gt;
 	$title = $arr_uri[0];&lt;br /&gt;
 	$uri_qry= $arr_uri[1];&lt;br /&gt;
 	parse_str($uri_qry,$_REQUEST);&lt;br /&gt;
 	$action = $wgRequest-&amp;gt;getVal( &#039;action&#039;, &#039;view&#039; );&lt;br /&gt;
 	$title_force = $wgRequest-&amp;gt;getVal( &#039;title&#039; );&lt;br /&gt;
 	if (&#039;&#039; != $title_force) {&lt;br /&gt;
 		$title = $title_force;&lt;br /&gt;
 	}&lt;br /&gt;
 # 2005-10-25 END&lt;br /&gt;
&lt;br /&gt;
* Fourth change - optional and untested - allow title redirection&lt;br /&gt;
 if ( &#039;&#039; == $title &amp;amp;&amp;amp; &#039;delete&#039; != $action ) {&lt;br /&gt;
 	$wgTitle = Title::newFromText( wfMsgForContent( &#039;mainpage&#039; ) );&lt;br /&gt;
 # 2005-10-26 Woozle - 404 support - optional redirect based on &amp;quot;mediawiki:articlename&amp;quot;&lt;br /&gt;
 	if (&#039;&#039; == $wgTitle) {&lt;br /&gt;
 		$wgTitle = Title::newFromText( $title );&lt;br /&gt;
 	}&lt;br /&gt;
 # 2005-10-26 END&lt;br /&gt;
&lt;br /&gt;
* Fifth change - I&#039;m actually not sure if this is necessary, but don&#039;t have time to test uncommenting it:&lt;br /&gt;
 # 2005-10-25 Woozle - for 404 handling - block out redirection code&lt;br /&gt;
 # was -- if ((action is explicitly &amp;quot;view&amp;quot;) AND (title is not passed as param) OR (title is not in canonical form) AND ??&lt;br /&gt;
 #} else if ( ( $action == &#039;view&#039; ) &amp;amp;&amp;amp; 	(!isset( $_GET[&#039;title&#039;] ) || $wgTitle-&amp;gt;getPrefixedDBKey() != $_GET[&#039;title&#039;] ) &amp;amp;&amp;amp; !count( array_diff( array_keys( $_GET ), array( &#039;action&#039;, &#039;title&#039; ) ) ) )&lt;br /&gt;
 #{&lt;br /&gt;
 #	/* redirect to canonical url, make it a 301 to allow caching */&lt;br /&gt;
 #	$wgOut-&amp;gt;setSquidMaxage( 1200 );&lt;br /&gt;
 #	$wgOut-&amp;gt;redirect( $wgTitle-&amp;gt;getFullURL(), &#039;301&#039;);&lt;br /&gt;
 } else if ( NS_SPECIAL == $wgTitle-&amp;gt;getNamespace() ) {&lt;br /&gt;
===Finally===&lt;br /&gt;
Finally, put the modified index.php where it will be the page used to handle 404 errors.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Caveats&#039;&#039;&#039;:&lt;br /&gt;
** Your arbitrary URL will have its first character capitalized before it is displayed as the page&#039;s title or used to load another page (if you have set up a Mediawiki: page for it), although the URL shown will remain unchanged&lt;br /&gt;
** There is probably a lot of excess index.php code which can be stripped out, as it will never be executed in this context&lt;br /&gt;
** URLs ending in slashes appear to be a problem for some namespaces; the wiki code appears to be reading the URL from some place other than the modified code. (This doesn&#039;t seem to be a problem for version 1.5.)&lt;br /&gt;
** &amp;lt;s&amp;gt;All wiki links on the loaded page will point back to canonical wiki URLs, e.g. http://htyp.org/wiki/index.php/Main_Page; to change this. see &amp;quot;Shortening the links&amp;quot; below.&amp;lt;/s&amp;gt; 2006-02-16 This has been fixed.&lt;br /&gt;
** &amp;lt;s&amp;gt;Image thumbnail links don&#039;t work.&amp;lt;/s&amp;gt; 2006-02-16  This has been fixed.&lt;br /&gt;
* &#039;&#039;&#039;2006-02-16&#039;&#039;&#039; Notes:&lt;br /&gt;
** I changed the procedure a bit and page viewing now seems to work consistently, but I&#039;ve only checked a few pages for proper behavior. Please test thoroughly before using on a production page, and let me know what you find.&lt;br /&gt;
** &#039;&#039;&#039;Editing does not work properly&#039;&#039;&#039;&lt;br /&gt;
** If certain pages persist in showing old-style links, they may be cached; add &amp;quot;?action=purge&amp;quot; to the URL to clear the cache for a given page. If you are working on an active site using the old-style links, some pages may mysteriously revert to old-style links as visitors browse them through the old-style portal, causing the old-style to be re-cached.&lt;br /&gt;
** This method is probably not very compatible with most webstats generators, but I haven&#039;t tried it long enough to see what happens. Probably all pages will be logged as 404 errors, which isn&#039;t terribly useful.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note about CPU load&#039;&#039;&#039;: Obviously it has to do the same URL translation it would normally have to do and then determine that the file doesn&#039;t exist, but that shouldn&#039;t take any more cycles than locating an existing file; for URLs containing at least one slash, it should be quicker. Given all the processing done by the MediaWiki software for loading &amp;quot;normal&amp;quot; wiki pages, I suspect the difference is negligible.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
Please feel free to post comments here or on the Talk page if you try any of these procedures.&lt;br /&gt;
&lt;br /&gt;
===Using a 403 [forbidden] Handler===&lt;br /&gt;
Something I have found to work very well, is to force all files except index.php to &amp;quot;Deny from All&amp;quot; and use a 403 error handler to push all requests to index.php&lt;br /&gt;
&lt;br /&gt;
An example .htaccess:&lt;br /&gt;
 Deny from All&lt;br /&gt;
 &amp;lt;Files &amp;quot;index.php&amp;quot;&amp;gt;&lt;br /&gt;
    Allow from All&lt;br /&gt;
 &amp;lt;/Files&amp;gt;&lt;br /&gt;
 DirectoryIndex index.php&lt;br /&gt;
 ErrorDocument 403 /index.php&lt;br /&gt;
&lt;br /&gt;
This could probably be shortened up, but I have found it works great. :-)&lt;/div&gt;</summary>
		<author><name>64.110.252.116</name></author>
	</entry>
	<entry>
		<id>https://htyp.org/mw/index.php?title=MediaWiki/archive/customizing/URLs&amp;diff=3345</id>
		<title>MediaWiki/archive/customizing/URLs</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=MediaWiki/archive/customizing/URLs&amp;diff=3345"/>
		<updated>2006-02-23T10:05:31Z</updated>

		<summary type="html">&lt;p&gt;64.110.252.116: /* Using a 403 [forbidden] Handler */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{web software|MediaWiki}}: [[MediaWiki Customization|Customization]]: [[Shortening MediaWiki URLs]]&lt;br /&gt;
&lt;br /&gt;
There are (at least) two &amp;quot;standard&amp;quot; ways of prettifying MediaWiki URLs, documented [http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url here]. One uses Apache&#039;s mod_rewrite. Although it probably works well (I haven&#039;t tried it), it just seemed aesthetically unappealing, from a design point of view.&lt;br /&gt;
&lt;br /&gt;
There&#039;s also another way of doing it if you have access to httpd.conf or .htaccess. It&#039;s fairly tidy and quite flexible, though I don&#039;t know how much additional load it puts on the server (see brief discussion at the end).&lt;br /&gt;
==Using a 404 Handler==&lt;br /&gt;
It uses the 404 (missing page) redirect mechanism &amp;amp;mdash; a standard /index.php/ request is handled by the standard code (in index.php), but any other URL which doesn&#039;t correspond to an existing page (within the wiki or not) is handled by a modified index.php. For any given &amp;quot;nonexistent&amp;quot; URL of the form &amp;quot;http://yourdomain.com/nonexistent/page&amp;quot;, the code returns a wiki page entitled &amp;quot;Nonexistent/page&amp;quot;, with the &amp;quot;nonexistent&amp;quot; URL displayed as the URL for that page.&lt;br /&gt;
&lt;br /&gt;
There is also a feature wherein you can create a page called [[Mediawiki:your/url/here]] and it will redirect to an article whose title is the &#039;&#039;contents&#039;&#039; of that page. For example: http://wiki.vbz.net/Currentevents is redirected to [[vbzwiki:Current events]] because the page [[vbzwiki:MediaWiki:Currentevents]] contains the text &amp;quot;Current events&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First&#039;&#039;&#039;, in the main [[.htaccess]] file (or in httpd.conf if you prefer), assign a location to handle 404 errors such that a PHP file will be loaded -- either of these will do, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ErrorDocument 404 /errors/404/&lt;br /&gt;
ErrorDocument 404 /wiki404error.php&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the first instance, your modified index.php file would go in /errors/404/; in the second, it would be renamed wiki4040error.php and go in the same folder as the normal index.php.&lt;br /&gt;
&lt;br /&gt;
The remaining instructions depend on which MediaWiki version you are using.&lt;br /&gt;
===Version 1.4===&lt;br /&gt;
&#039;&#039;These instructions were made from changes that actually worked, but I may have left out some steps. I was more careful when I did the changes for version 1.5, so if these don&#039;t work check the version 1.5 instructions for anything missing.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Second&#039;&#039;&#039;: Make the changes indicated in the 404-handling copy of index.php:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if ( &#039;&#039; == $title &amp;amp;&amp;amp; &#039;delete&#039; != $action ) {&lt;br /&gt;
## 2005-06-19 Woozle mods for &amp;quot;missing&amp;quot; page&lt;br /&gt;
	# title not passed in parameter; use REQUEST_URI from environment&lt;br /&gt;
	$title = rawurldecode(ltrim($_SERVER[&#039;REQUEST_URI&#039;], &amp;quot; /&amp;quot;));&lt;br /&gt;
	# see if there&#039;s a page designated for this URI&lt;br /&gt;
	$wgTitle = Title::newFromText( wfMsgForContent( $title ) );&lt;br /&gt;
	if (&#039;&#039; == $wgTitle) {&lt;br /&gt;
		$wgTitle = Title::newFromText( $title );&lt;br /&gt;
	}&lt;br /&gt;
## end Woozle mods&lt;br /&gt;
} elseif ( $curid = $wgRequest-&amp;gt;getInt( &#039;curid&#039; ) ) {&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	/* redirect to canonical url, make it a 301 to allow caching */&lt;br /&gt;
	$wgOut-&amp;gt;setSquidMaxage( 1200 );&lt;br /&gt;
# 2005-06-21 Woozle mods to allow 404 page to summon wiki page without redirecting&lt;br /&gt;
#	$wgOut-&amp;gt;redirect( $wgTitle-&amp;gt;getFullURL(), &#039;301&#039;);&lt;br /&gt;
	$wgArticle = new Article( $wgTitle );&lt;br /&gt;
#  	$mainText = $wgOut-&amp;gt;parse( $wgArticle-&amp;gt;getContent( false ) );&lt;br /&gt;
#	echo $mainText;&lt;br /&gt;
	$wgArticle-&amp;gt;view();&lt;br /&gt;
# end Woozle mods&lt;br /&gt;
} else if ( Namespace::getSpecial() == $wgTitle-&amp;gt;getNamespace() ) {&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Version 1.5===&lt;br /&gt;
&#039;&#039;&#039;Second&#039;&#039;&#039;: In the same folder as the modified index.php, create a LocalSettings.php with the following contents:&lt;br /&gt;
 &amp;lt;?php&lt;br /&gt;
 require_once( &amp;quot;../../LocalSettings.php&amp;quot; );&lt;br /&gt;
 &lt;br /&gt;
 $wgScript           = $wgScriptPath;&lt;br /&gt;
 $wgArticlePath      = &amp;quot;$wgScript/$1&amp;quot;;&lt;br /&gt;
 ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: &amp;quot;../../LocalSettings.php&amp;quot; works if your modified index.php is buried two folders deep from your main index.php (as in the /errors/404/index.php example); adjust it as needed to point to your main LocalSettings.php.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Third&#039;&#039;&#039;: Make the changes indicated in the 404-handling copy of index.php:&lt;br /&gt;
&lt;br /&gt;
* First change - need to point to the copied Defines.php:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# 2005-10-25 Woozle - for 404 handling&lt;br /&gt;
require_once( &#039;./Defines.php&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Second change - this is optional, but it cleans up the file a lot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# 2005-10-25 Woozle - config code removed because it will never be executed&lt;br /&gt;
#if( !file_exists( &#039;LocalSettings.php&#039; ) ) {&lt;br /&gt;
# ...&lt;br /&gt;
#}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Third change - this pulls in the title-request from the error URI:&lt;br /&gt;
 # Query string fields&lt;br /&gt;
 # 2005-10-25 Woozle - 404 support - parameters have to be parsed from $_SERVER instead of $_REQUEST&lt;br /&gt;
 	$raw_uri = rawurldecode(ltrim($_SERVER[&#039;REQUEST_URI&#039;], &amp;quot; /&amp;quot;));&lt;br /&gt;
 	$arr_uri = explode(&#039;?&#039;,$raw_uri);&lt;br /&gt;
 	$title = $arr_uri[0];&lt;br /&gt;
 	$uri_qry= $arr_uri[1];&lt;br /&gt;
 	parse_str($uri_qry,$_REQUEST);&lt;br /&gt;
 	$action = $wgRequest-&amp;gt;getVal( &#039;action&#039;, &#039;view&#039; );&lt;br /&gt;
 	$title_force = $wgRequest-&amp;gt;getVal( &#039;title&#039; );&lt;br /&gt;
 	if (&#039;&#039; != $title_force) {&lt;br /&gt;
 		$title = $title_force;&lt;br /&gt;
 	}&lt;br /&gt;
 # 2005-10-25 END&lt;br /&gt;
&lt;br /&gt;
* Fourth change - optional and untested - allow title redirection&lt;br /&gt;
 if ( &#039;&#039; == $title &amp;amp;&amp;amp; &#039;delete&#039; != $action ) {&lt;br /&gt;
 	$wgTitle = Title::newFromText( wfMsgForContent( &#039;mainpage&#039; ) );&lt;br /&gt;
 # 2005-10-26 Woozle - 404 support - optional redirect based on &amp;quot;mediawiki:articlename&amp;quot;&lt;br /&gt;
 	if (&#039;&#039; == $wgTitle) {&lt;br /&gt;
 		$wgTitle = Title::newFromText( $title );&lt;br /&gt;
 	}&lt;br /&gt;
 # 2005-10-26 END&lt;br /&gt;
&lt;br /&gt;
* Fifth change - I&#039;m actually not sure if this is necessary, but don&#039;t have time to test uncommenting it:&lt;br /&gt;
 # 2005-10-25 Woozle - for 404 handling - block out redirection code&lt;br /&gt;
 # was -- if ((action is explicitly &amp;quot;view&amp;quot;) AND (title is not passed as param) OR (title is not in canonical form) AND ??&lt;br /&gt;
 #} else if ( ( $action == &#039;view&#039; ) &amp;amp;&amp;amp; 	(!isset( $_GET[&#039;title&#039;] ) || $wgTitle-&amp;gt;getPrefixedDBKey() != $_GET[&#039;title&#039;] ) &amp;amp;&amp;amp; !count( array_diff( array_keys( $_GET ), array( &#039;action&#039;, &#039;title&#039; ) ) ) )&lt;br /&gt;
 #{&lt;br /&gt;
 #	/* redirect to canonical url, make it a 301 to allow caching */&lt;br /&gt;
 #	$wgOut-&amp;gt;setSquidMaxage( 1200 );&lt;br /&gt;
 #	$wgOut-&amp;gt;redirect( $wgTitle-&amp;gt;getFullURL(), &#039;301&#039;);&lt;br /&gt;
 } else if ( NS_SPECIAL == $wgTitle-&amp;gt;getNamespace() ) {&lt;br /&gt;
===Finally===&lt;br /&gt;
Finally, put the modified index.php where it will be the page used to handle 404 errors.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Caveats&#039;&#039;&#039;:&lt;br /&gt;
** Your arbitrary URL will have its first character capitalized before it is displayed as the page&#039;s title or used to load another page (if you have set up a Mediawiki: page for it), although the URL shown will remain unchanged&lt;br /&gt;
** There is probably a lot of excess index.php code which can be stripped out, as it will never be executed in this context&lt;br /&gt;
** URLs ending in slashes appear to be a problem for some namespaces; the wiki code appears to be reading the URL from some place other than the modified code. (This doesn&#039;t seem to be a problem for version 1.5.)&lt;br /&gt;
** &amp;lt;s&amp;gt;All wiki links on the loaded page will point back to canonical wiki URLs, e.g. http://htyp.org/wiki/index.php/Main_Page; to change this. see &amp;quot;Shortening the links&amp;quot; below.&amp;lt;/s&amp;gt; 2006-02-16 This has been fixed.&lt;br /&gt;
** &amp;lt;s&amp;gt;Image thumbnail links don&#039;t work.&amp;lt;/s&amp;gt; 2006-02-16  This has been fixed.&lt;br /&gt;
* &#039;&#039;&#039;2006-02-16&#039;&#039;&#039; Notes:&lt;br /&gt;
** I changed the procedure a bit and page viewing now seems to work consistently, but I&#039;ve only checked a few pages for proper behavior. Please test thoroughly before using on a production page, and let me know what you find.&lt;br /&gt;
** &#039;&#039;&#039;Editing does not work properly&#039;&#039;&#039;&lt;br /&gt;
** If certain pages persist in showing old-style links, they may be cached; add &amp;quot;?action=purge&amp;quot; to the URL to clear the cache for a given page. If you are working on an active site using the old-style links, some pages may mysteriously revert to old-style links as visitors browse them through the old-style portal, causing the old-style to be re-cached.&lt;br /&gt;
** This method is probably not very compatible with most webstats generators, but I haven&#039;t tried it long enough to see what happens. Probably all pages will be logged as 404 errors, which isn&#039;t terribly useful.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note about CPU load&#039;&#039;&#039;: Obviously it has to do the same URL translation it would normally have to do and then determine that the file doesn&#039;t exist, but that shouldn&#039;t take any more cycles than locating an existing file; for URLs containing at least one slash, it should be quicker. Given all the processing done by the MediaWiki software for loading &amp;quot;normal&amp;quot; wiki pages, I suspect the difference is negligible.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
Please feel free to post comments here or on the Talk page if you try any of these procedures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Using a 403 [forbidden] Handler===&lt;br /&gt;
Something I have found to work very well, is to force all files except index.php to &amp;quot;Deny from All&amp;quot; and use a 403 error handler to push all requests to index.php&lt;br /&gt;
&lt;br /&gt;
An example .htaccess:&lt;br /&gt;
 Deny from All&lt;br /&gt;
 &amp;lt;Files &amp;quot;index.php&amp;quot;&amp;gt;&lt;br /&gt;
    Allow from All&lt;br /&gt;
 &amp;lt;/Files&amp;gt;&lt;br /&gt;
 DirectoryIndex index.php&lt;br /&gt;
 ErrorDocument 403 /index.php&lt;br /&gt;
&lt;br /&gt;
This could probably be shortened up, but I have found it works great. :-)&lt;/div&gt;</summary>
		<author><name>64.110.252.116</name></author>
	</entry>
	<entry>
		<id>https://htyp.org/mw/index.php?title=MediaWiki/archive/customizing/URLs&amp;diff=3344</id>
		<title>MediaWiki/archive/customizing/URLs</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=MediaWiki/archive/customizing/URLs&amp;diff=3344"/>
		<updated>2006-02-23T10:03:53Z</updated>

		<summary type="html">&lt;p&gt;64.110.252.116: /* Using a 403 [forbidden] Handler */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{web software|MediaWiki}}: [[MediaWiki Customization|Customization]]: [[Shortening MediaWiki URLs]]&lt;br /&gt;
&lt;br /&gt;
There are (at least) two &amp;quot;standard&amp;quot; ways of prettifying MediaWiki URLs, documented [http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url here]. One uses Apache&#039;s mod_rewrite. Although it probably works well (I haven&#039;t tried it), it just seemed aesthetically unappealing, from a design point of view.&lt;br /&gt;
&lt;br /&gt;
There&#039;s also another way of doing it if you have access to httpd.conf or .htaccess. It&#039;s fairly tidy and quite flexible, though I don&#039;t know how much additional load it puts on the server (see brief discussion at the end).&lt;br /&gt;
==Using a 404 Handler==&lt;br /&gt;
It uses the 404 (missing page) redirect mechanism &amp;amp;mdash; a standard /index.php/ request is handled by the standard code (in index.php), but any other URL which doesn&#039;t correspond to an existing page (within the wiki or not) is handled by a modified index.php. For any given &amp;quot;nonexistent&amp;quot; URL of the form &amp;quot;http://yourdomain.com/nonexistent/page&amp;quot;, the code returns a wiki page entitled &amp;quot;Nonexistent/page&amp;quot;, with the &amp;quot;nonexistent&amp;quot; URL displayed as the URL for that page.&lt;br /&gt;
&lt;br /&gt;
There is also a feature wherein you can create a page called [[Mediawiki:your/url/here]] and it will redirect to an article whose title is the &#039;&#039;contents&#039;&#039; of that page. For example: http://wiki.vbz.net/Currentevents is redirected to [[vbzwiki:Current events]] because the page [[vbzwiki:MediaWiki:Currentevents]] contains the text &amp;quot;Current events&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First&#039;&#039;&#039;, in the main [[.htaccess]] file (or in httpd.conf if you prefer), assign a location to handle 404 errors such that a PHP file will be loaded -- either of these will do, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ErrorDocument 404 /errors/404/&lt;br /&gt;
ErrorDocument 404 /wiki404error.php&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the first instance, your modified index.php file would go in /errors/404/; in the second, it would be renamed wiki4040error.php and go in the same folder as the normal index.php.&lt;br /&gt;
&lt;br /&gt;
The remaining instructions depend on which MediaWiki version you are using.&lt;br /&gt;
===Version 1.4===&lt;br /&gt;
&#039;&#039;These instructions were made from changes that actually worked, but I may have left out some steps. I was more careful when I did the changes for version 1.5, so if these don&#039;t work check the version 1.5 instructions for anything missing.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Second&#039;&#039;&#039;: Make the changes indicated in the 404-handling copy of index.php:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if ( &#039;&#039; == $title &amp;amp;&amp;amp; &#039;delete&#039; != $action ) {&lt;br /&gt;
## 2005-06-19 Woozle mods for &amp;quot;missing&amp;quot; page&lt;br /&gt;
	# title not passed in parameter; use REQUEST_URI from environment&lt;br /&gt;
	$title = rawurldecode(ltrim($_SERVER[&#039;REQUEST_URI&#039;], &amp;quot; /&amp;quot;));&lt;br /&gt;
	# see if there&#039;s a page designated for this URI&lt;br /&gt;
	$wgTitle = Title::newFromText( wfMsgForContent( $title ) );&lt;br /&gt;
	if (&#039;&#039; == $wgTitle) {&lt;br /&gt;
		$wgTitle = Title::newFromText( $title );&lt;br /&gt;
	}&lt;br /&gt;
## end Woozle mods&lt;br /&gt;
} elseif ( $curid = $wgRequest-&amp;gt;getInt( &#039;curid&#039; ) ) {&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	/* redirect to canonical url, make it a 301 to allow caching */&lt;br /&gt;
	$wgOut-&amp;gt;setSquidMaxage( 1200 );&lt;br /&gt;
# 2005-06-21 Woozle mods to allow 404 page to summon wiki page without redirecting&lt;br /&gt;
#	$wgOut-&amp;gt;redirect( $wgTitle-&amp;gt;getFullURL(), &#039;301&#039;);&lt;br /&gt;
	$wgArticle = new Article( $wgTitle );&lt;br /&gt;
#  	$mainText = $wgOut-&amp;gt;parse( $wgArticle-&amp;gt;getContent( false ) );&lt;br /&gt;
#	echo $mainText;&lt;br /&gt;
	$wgArticle-&amp;gt;view();&lt;br /&gt;
# end Woozle mods&lt;br /&gt;
} else if ( Namespace::getSpecial() == $wgTitle-&amp;gt;getNamespace() ) {&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Version 1.5===&lt;br /&gt;
&#039;&#039;&#039;Second&#039;&#039;&#039;: In the same folder as the modified index.php, create a LocalSettings.php with the following contents:&lt;br /&gt;
 &amp;lt;?php&lt;br /&gt;
 require_once( &amp;quot;../../LocalSettings.php&amp;quot; );&lt;br /&gt;
 &lt;br /&gt;
 $wgScript           = $wgScriptPath;&lt;br /&gt;
 $wgArticlePath      = &amp;quot;$wgScript/$1&amp;quot;;&lt;br /&gt;
 ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: &amp;quot;../../LocalSettings.php&amp;quot; works if your modified index.php is buried two folders deep from your main index.php (as in the /errors/404/index.php example); adjust it as needed to point to your main LocalSettings.php.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Third&#039;&#039;&#039;: Make the changes indicated in the 404-handling copy of index.php:&lt;br /&gt;
&lt;br /&gt;
* First change - need to point to the copied Defines.php:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# 2005-10-25 Woozle - for 404 handling&lt;br /&gt;
require_once( &#039;./Defines.php&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Second change - this is optional, but it cleans up the file a lot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# 2005-10-25 Woozle - config code removed because it will never be executed&lt;br /&gt;
#if( !file_exists( &#039;LocalSettings.php&#039; ) ) {&lt;br /&gt;
# ...&lt;br /&gt;
#}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Third change - this pulls in the title-request from the error URI:&lt;br /&gt;
 # Query string fields&lt;br /&gt;
 # 2005-10-25 Woozle - 404 support - parameters have to be parsed from $_SERVER instead of $_REQUEST&lt;br /&gt;
 	$raw_uri = rawurldecode(ltrim($_SERVER[&#039;REQUEST_URI&#039;], &amp;quot; /&amp;quot;));&lt;br /&gt;
 	$arr_uri = explode(&#039;?&#039;,$raw_uri);&lt;br /&gt;
 	$title = $arr_uri[0];&lt;br /&gt;
 	$uri_qry= $arr_uri[1];&lt;br /&gt;
 	parse_str($uri_qry,$_REQUEST);&lt;br /&gt;
 	$action = $wgRequest-&amp;gt;getVal( &#039;action&#039;, &#039;view&#039; );&lt;br /&gt;
 	$title_force = $wgRequest-&amp;gt;getVal( &#039;title&#039; );&lt;br /&gt;
 	if (&#039;&#039; != $title_force) {&lt;br /&gt;
 		$title = $title_force;&lt;br /&gt;
 	}&lt;br /&gt;
 # 2005-10-25 END&lt;br /&gt;
&lt;br /&gt;
* Fourth change - optional and untested - allow title redirection&lt;br /&gt;
 if ( &#039;&#039; == $title &amp;amp;&amp;amp; &#039;delete&#039; != $action ) {&lt;br /&gt;
 	$wgTitle = Title::newFromText( wfMsgForContent( &#039;mainpage&#039; ) );&lt;br /&gt;
 # 2005-10-26 Woozle - 404 support - optional redirect based on &amp;quot;mediawiki:articlename&amp;quot;&lt;br /&gt;
 	if (&#039;&#039; == $wgTitle) {&lt;br /&gt;
 		$wgTitle = Title::newFromText( $title );&lt;br /&gt;
 	}&lt;br /&gt;
 # 2005-10-26 END&lt;br /&gt;
&lt;br /&gt;
* Fifth change - I&#039;m actually not sure if this is necessary, but don&#039;t have time to test uncommenting it:&lt;br /&gt;
 # 2005-10-25 Woozle - for 404 handling - block out redirection code&lt;br /&gt;
 # was -- if ((action is explicitly &amp;quot;view&amp;quot;) AND (title is not passed as param) OR (title is not in canonical form) AND ??&lt;br /&gt;
 #} else if ( ( $action == &#039;view&#039; ) &amp;amp;&amp;amp; 	(!isset( $_GET[&#039;title&#039;] ) || $wgTitle-&amp;gt;getPrefixedDBKey() != $_GET[&#039;title&#039;] ) &amp;amp;&amp;amp; !count( array_diff( array_keys( $_GET ), array( &#039;action&#039;, &#039;title&#039; ) ) ) )&lt;br /&gt;
 #{&lt;br /&gt;
 #	/* redirect to canonical url, make it a 301 to allow caching */&lt;br /&gt;
 #	$wgOut-&amp;gt;setSquidMaxage( 1200 );&lt;br /&gt;
 #	$wgOut-&amp;gt;redirect( $wgTitle-&amp;gt;getFullURL(), &#039;301&#039;);&lt;br /&gt;
 } else if ( NS_SPECIAL == $wgTitle-&amp;gt;getNamespace() ) {&lt;br /&gt;
===Finally===&lt;br /&gt;
Finally, put the modified index.php where it will be the page used to handle 404 errors.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Caveats&#039;&#039;&#039;:&lt;br /&gt;
** Your arbitrary URL will have its first character capitalized before it is displayed as the page&#039;s title or used to load another page (if you have set up a Mediawiki: page for it), although the URL shown will remain unchanged&lt;br /&gt;
** There is probably a lot of excess index.php code which can be stripped out, as it will never be executed in this context&lt;br /&gt;
** URLs ending in slashes appear to be a problem for some namespaces; the wiki code appears to be reading the URL from some place other than the modified code. (This doesn&#039;t seem to be a problem for version 1.5.)&lt;br /&gt;
** &amp;lt;s&amp;gt;All wiki links on the loaded page will point back to canonical wiki URLs, e.g. http://htyp.org/wiki/index.php/Main_Page; to change this. see &amp;quot;Shortening the links&amp;quot; below.&amp;lt;/s&amp;gt; 2006-02-16 This has been fixed.&lt;br /&gt;
** &amp;lt;s&amp;gt;Image thumbnail links don&#039;t work.&amp;lt;/s&amp;gt; 2006-02-16  This has been fixed.&lt;br /&gt;
* &#039;&#039;&#039;2006-02-16&#039;&#039;&#039; Notes:&lt;br /&gt;
** I changed the procedure a bit and page viewing now seems to work consistently, but I&#039;ve only checked a few pages for proper behavior. Please test thoroughly before using on a production page, and let me know what you find.&lt;br /&gt;
** &#039;&#039;&#039;Editing does not work properly&#039;&#039;&#039;&lt;br /&gt;
** If certain pages persist in showing old-style links, they may be cached; add &amp;quot;?action=purge&amp;quot; to the URL to clear the cache for a given page. If you are working on an active site using the old-style links, some pages may mysteriously revert to old-style links as visitors browse them through the old-style portal, causing the old-style to be re-cached.&lt;br /&gt;
** This method is probably not very compatible with most webstats generators, but I haven&#039;t tried it long enough to see what happens. Probably all pages will be logged as 404 errors, which isn&#039;t terribly useful.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note about CPU load&#039;&#039;&#039;: Obviously it has to do the same URL translation it would normally have to do and then determine that the file doesn&#039;t exist, but that shouldn&#039;t take any more cycles than locating an existing file; for URLs containing at least one slash, it should be quicker. Given all the processing done by the MediaWiki software for loading &amp;quot;normal&amp;quot; wiki pages, I suspect the difference is negligible.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
Please feel free to post comments here or on the Talk page if you try any of these procedures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Using a 403 [forbidden] Handler===&lt;br /&gt;
Something I have found to work very well, is to force all files except index.php to &amp;quot;Deny from All&amp;quot; and use a 403 error handler to push all requests to index.php&lt;br /&gt;
&lt;br /&gt;
An example .htaccess:&lt;br /&gt;
 Order Allow,Deny&lt;br /&gt;
 &amp;lt;Files &amp;quot;index.php&amp;quot;&amp;gt;&lt;br /&gt;
    ForceType application/x-httpd-php&lt;br /&gt;
    Allow from All&lt;br /&gt;
 &amp;lt;/Files&amp;gt;&lt;br /&gt;
 Deny from All&lt;br /&gt;
 DirectoryIndex index.php&lt;br /&gt;
 ErrorDocument 403 /index.php&lt;br /&gt;
&lt;br /&gt;
This could probably be shortened up, but I have found it works great. :-)&lt;/div&gt;</summary>
		<author><name>64.110.252.116</name></author>
	</entry>
	<entry>
		<id>https://htyp.org/mw/index.php?title=MediaWiki/archive/customizing/URLs&amp;diff=3343</id>
		<title>MediaWiki/archive/customizing/URLs</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=MediaWiki/archive/customizing/URLs&amp;diff=3343"/>
		<updated>2006-02-23T10:01:02Z</updated>

		<summary type="html">&lt;p&gt;64.110.252.116: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{web software|MediaWiki}}: [[MediaWiki Customization|Customization]]: [[Shortening MediaWiki URLs]]&lt;br /&gt;
&lt;br /&gt;
There are (at least) two &amp;quot;standard&amp;quot; ways of prettifying MediaWiki URLs, documented [http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url here]. One uses Apache&#039;s mod_rewrite. Although it probably works well (I haven&#039;t tried it), it just seemed aesthetically unappealing, from a design point of view.&lt;br /&gt;
&lt;br /&gt;
There&#039;s also another way of doing it if you have access to httpd.conf or .htaccess. It&#039;s fairly tidy and quite flexible, though I don&#039;t know how much additional load it puts on the server (see brief discussion at the end).&lt;br /&gt;
==Using a 404 Handler==&lt;br /&gt;
It uses the 404 (missing page) redirect mechanism &amp;amp;mdash; a standard /index.php/ request is handled by the standard code (in index.php), but any other URL which doesn&#039;t correspond to an existing page (within the wiki or not) is handled by a modified index.php. For any given &amp;quot;nonexistent&amp;quot; URL of the form &amp;quot;http://yourdomain.com/nonexistent/page&amp;quot;, the code returns a wiki page entitled &amp;quot;Nonexistent/page&amp;quot;, with the &amp;quot;nonexistent&amp;quot; URL displayed as the URL for that page.&lt;br /&gt;
&lt;br /&gt;
There is also a feature wherein you can create a page called [[Mediawiki:your/url/here]] and it will redirect to an article whose title is the &#039;&#039;contents&#039;&#039; of that page. For example: http://wiki.vbz.net/Currentevents is redirected to [[vbzwiki:Current events]] because the page [[vbzwiki:MediaWiki:Currentevents]] contains the text &amp;quot;Current events&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First&#039;&#039;&#039;, in the main [[.htaccess]] file (or in httpd.conf if you prefer), assign a location to handle 404 errors such that a PHP file will be loaded -- either of these will do, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ErrorDocument 404 /errors/404/&lt;br /&gt;
ErrorDocument 404 /wiki404error.php&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the first instance, your modified index.php file would go in /errors/404/; in the second, it would be renamed wiki4040error.php and go in the same folder as the normal index.php.&lt;br /&gt;
&lt;br /&gt;
The remaining instructions depend on which MediaWiki version you are using.&lt;br /&gt;
===Version 1.4===&lt;br /&gt;
&#039;&#039;These instructions were made from changes that actually worked, but I may have left out some steps. I was more careful when I did the changes for version 1.5, so if these don&#039;t work check the version 1.5 instructions for anything missing.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Second&#039;&#039;&#039;: Make the changes indicated in the 404-handling copy of index.php:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if ( &#039;&#039; == $title &amp;amp;&amp;amp; &#039;delete&#039; != $action ) {&lt;br /&gt;
## 2005-06-19 Woozle mods for &amp;quot;missing&amp;quot; page&lt;br /&gt;
	# title not passed in parameter; use REQUEST_URI from environment&lt;br /&gt;
	$title = rawurldecode(ltrim($_SERVER[&#039;REQUEST_URI&#039;], &amp;quot; /&amp;quot;));&lt;br /&gt;
	# see if there&#039;s a page designated for this URI&lt;br /&gt;
	$wgTitle = Title::newFromText( wfMsgForContent( $title ) );&lt;br /&gt;
	if (&#039;&#039; == $wgTitle) {&lt;br /&gt;
		$wgTitle = Title::newFromText( $title );&lt;br /&gt;
	}&lt;br /&gt;
## end Woozle mods&lt;br /&gt;
} elseif ( $curid = $wgRequest-&amp;gt;getInt( &#039;curid&#039; ) ) {&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	/* redirect to canonical url, make it a 301 to allow caching */&lt;br /&gt;
	$wgOut-&amp;gt;setSquidMaxage( 1200 );&lt;br /&gt;
# 2005-06-21 Woozle mods to allow 404 page to summon wiki page without redirecting&lt;br /&gt;
#	$wgOut-&amp;gt;redirect( $wgTitle-&amp;gt;getFullURL(), &#039;301&#039;);&lt;br /&gt;
	$wgArticle = new Article( $wgTitle );&lt;br /&gt;
#  	$mainText = $wgOut-&amp;gt;parse( $wgArticle-&amp;gt;getContent( false ) );&lt;br /&gt;
#	echo $mainText;&lt;br /&gt;
	$wgArticle-&amp;gt;view();&lt;br /&gt;
# end Woozle mods&lt;br /&gt;
} else if ( Namespace::getSpecial() == $wgTitle-&amp;gt;getNamespace() ) {&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Version 1.5===&lt;br /&gt;
&#039;&#039;&#039;Second&#039;&#039;&#039;: In the same folder as the modified index.php, create a LocalSettings.php with the following contents:&lt;br /&gt;
 &amp;lt;?php&lt;br /&gt;
 require_once( &amp;quot;../../LocalSettings.php&amp;quot; );&lt;br /&gt;
 &lt;br /&gt;
 $wgScript           = $wgScriptPath;&lt;br /&gt;
 $wgArticlePath      = &amp;quot;$wgScript/$1&amp;quot;;&lt;br /&gt;
 ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: &amp;quot;../../LocalSettings.php&amp;quot; works if your modified index.php is buried two folders deep from your main index.php (as in the /errors/404/index.php example); adjust it as needed to point to your main LocalSettings.php.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Third&#039;&#039;&#039;: Make the changes indicated in the 404-handling copy of index.php:&lt;br /&gt;
&lt;br /&gt;
* First change - need to point to the copied Defines.php:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# 2005-10-25 Woozle - for 404 handling&lt;br /&gt;
require_once( &#039;./Defines.php&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Second change - this is optional, but it cleans up the file a lot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# 2005-10-25 Woozle - config code removed because it will never be executed&lt;br /&gt;
#if( !file_exists( &#039;LocalSettings.php&#039; ) ) {&lt;br /&gt;
# ...&lt;br /&gt;
#}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Third change - this pulls in the title-request from the error URI:&lt;br /&gt;
 # Query string fields&lt;br /&gt;
 # 2005-10-25 Woozle - 404 support - parameters have to be parsed from $_SERVER instead of $_REQUEST&lt;br /&gt;
 	$raw_uri = rawurldecode(ltrim($_SERVER[&#039;REQUEST_URI&#039;], &amp;quot; /&amp;quot;));&lt;br /&gt;
 	$arr_uri = explode(&#039;?&#039;,$raw_uri);&lt;br /&gt;
 	$title = $arr_uri[0];&lt;br /&gt;
 	$uri_qry= $arr_uri[1];&lt;br /&gt;
 	parse_str($uri_qry,$_REQUEST);&lt;br /&gt;
 	$action = $wgRequest-&amp;gt;getVal( &#039;action&#039;, &#039;view&#039; );&lt;br /&gt;
 	$title_force = $wgRequest-&amp;gt;getVal( &#039;title&#039; );&lt;br /&gt;
 	if (&#039;&#039; != $title_force) {&lt;br /&gt;
 		$title = $title_force;&lt;br /&gt;
 	}&lt;br /&gt;
 # 2005-10-25 END&lt;br /&gt;
&lt;br /&gt;
* Fourth change - optional and untested - allow title redirection&lt;br /&gt;
 if ( &#039;&#039; == $title &amp;amp;&amp;amp; &#039;delete&#039; != $action ) {&lt;br /&gt;
 	$wgTitle = Title::newFromText( wfMsgForContent( &#039;mainpage&#039; ) );&lt;br /&gt;
 # 2005-10-26 Woozle - 404 support - optional redirect based on &amp;quot;mediawiki:articlename&amp;quot;&lt;br /&gt;
 	if (&#039;&#039; == $wgTitle) {&lt;br /&gt;
 		$wgTitle = Title::newFromText( $title );&lt;br /&gt;
 	}&lt;br /&gt;
 # 2005-10-26 END&lt;br /&gt;
&lt;br /&gt;
* Fifth change - I&#039;m actually not sure if this is necessary, but don&#039;t have time to test uncommenting it:&lt;br /&gt;
 # 2005-10-25 Woozle - for 404 handling - block out redirection code&lt;br /&gt;
 # was -- if ((action is explicitly &amp;quot;view&amp;quot;) AND (title is not passed as param) OR (title is not in canonical form) AND ??&lt;br /&gt;
 #} else if ( ( $action == &#039;view&#039; ) &amp;amp;&amp;amp; 	(!isset( $_GET[&#039;title&#039;] ) || $wgTitle-&amp;gt;getPrefixedDBKey() != $_GET[&#039;title&#039;] ) &amp;amp;&amp;amp; !count( array_diff( array_keys( $_GET ), array( &#039;action&#039;, &#039;title&#039; ) ) ) )&lt;br /&gt;
 #{&lt;br /&gt;
 #	/* redirect to canonical url, make it a 301 to allow caching */&lt;br /&gt;
 #	$wgOut-&amp;gt;setSquidMaxage( 1200 );&lt;br /&gt;
 #	$wgOut-&amp;gt;redirect( $wgTitle-&amp;gt;getFullURL(), &#039;301&#039;);&lt;br /&gt;
 } else if ( NS_SPECIAL == $wgTitle-&amp;gt;getNamespace() ) {&lt;br /&gt;
===Finally===&lt;br /&gt;
Finally, put the modified index.php where it will be the page used to handle 404 errors.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Caveats&#039;&#039;&#039;:&lt;br /&gt;
** Your arbitrary URL will have its first character capitalized before it is displayed as the page&#039;s title or used to load another page (if you have set up a Mediawiki: page for it), although the URL shown will remain unchanged&lt;br /&gt;
** There is probably a lot of excess index.php code which can be stripped out, as it will never be executed in this context&lt;br /&gt;
** URLs ending in slashes appear to be a problem for some namespaces; the wiki code appears to be reading the URL from some place other than the modified code. (This doesn&#039;t seem to be a problem for version 1.5.)&lt;br /&gt;
** &amp;lt;s&amp;gt;All wiki links on the loaded page will point back to canonical wiki URLs, e.g. http://htyp.org/wiki/index.php/Main_Page; to change this. see &amp;quot;Shortening the links&amp;quot; below.&amp;lt;/s&amp;gt; 2006-02-16 This has been fixed.&lt;br /&gt;
** &amp;lt;s&amp;gt;Image thumbnail links don&#039;t work.&amp;lt;/s&amp;gt; 2006-02-16  This has been fixed.&lt;br /&gt;
* &#039;&#039;&#039;2006-02-16&#039;&#039;&#039; Notes:&lt;br /&gt;
** I changed the procedure a bit and page viewing now seems to work consistently, but I&#039;ve only checked a few pages for proper behavior. Please test thoroughly before using on a production page, and let me know what you find.&lt;br /&gt;
** &#039;&#039;&#039;Editing does not work properly&#039;&#039;&#039;&lt;br /&gt;
** If certain pages persist in showing old-style links, they may be cached; add &amp;quot;?action=purge&amp;quot; to the URL to clear the cache for a given page. If you are working on an active site using the old-style links, some pages may mysteriously revert to old-style links as visitors browse them through the old-style portal, causing the old-style to be re-cached.&lt;br /&gt;
** This method is probably not very compatible with most webstats generators, but I haven&#039;t tried it long enough to see what happens. Probably all pages will be logged as 404 errors, which isn&#039;t terribly useful.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note about CPU load&#039;&#039;&#039;: Obviously it has to do the same URL translation it would normally have to do and then determine that the file doesn&#039;t exist, but that shouldn&#039;t take any more cycles than locating an existing file; for URLs containing at least one slash, it should be quicker. Given all the processing done by the MediaWiki software for loading &amp;quot;normal&amp;quot; wiki pages, I suspect the difference is negligible.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
Please feel free to post comments here or on the Talk page if you try any of these procedures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Using a 403 [forbidden] Handler==&lt;br /&gt;
Something I have found to work very well, is to force all files except index.php to &amp;quot;Deny from All&amp;quot; and use a 403 error handler to push all requests to index.php&lt;br /&gt;
&lt;br /&gt;
An example .htaccess:&lt;br /&gt;
 Order Allow,Deny&lt;br /&gt;
 &amp;lt;Files &amp;quot;index.php&amp;quot;&amp;gt;&lt;br /&gt;
    ForceType application/x-httpd-php&lt;br /&gt;
    Allow from All&lt;br /&gt;
 &amp;lt;/Files&amp;gt;&lt;br /&gt;
 Deny from All&lt;br /&gt;
 DirectoryIndex index.php&lt;br /&gt;
 ErrorDocument 403 /index.php&lt;br /&gt;
&lt;br /&gt;
This could probably be shortened up, but I have found it works great. :-)&lt;/div&gt;</summary>
		<author><name>64.110.252.116</name></author>
	</entry>
</feed>