http://dadaweb.de/index.php?title=URL-K%C3%BCrzung&feed=atom&action=historyURL-Kürzung - Versionsgeschichte2024-03-29T11:38:47ZVersionsgeschichte dieser Seite in DadAWebMediaWiki 1.30.1http://dadaweb.de/index.php?title=URL-K%C3%BCrzung&diff=4358&oldid=prevWikiSysop am 13. November 2006 um 19:48 Uhr2006-11-13T19:48:29Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr style="vertical-align: top;" lang="de">
<td colspan="2" style="background-color: white; color:black; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: white; color:black; text-align: center;">Version vom 13. November 2006, 19:48 Uhr</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Zeile 1:</td>
<td colspan="2" class="diff-lineno">Zeile 1:</td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Quelle: http://meta.wikimedia.org/wiki/Using_a_very_short_URL</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The page describes the steps needed to set up MediaWiki to use URLs without "index.php".   </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The page describes the steps needed to set up MediaWiki to use URLs without "index.php".   </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>For example:</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>For example:</div></td></tr>
</table>WikiSysophttp://dadaweb.de/index.php?title=URL-K%C3%BCrzung&diff=3943&oldid=prevWikiSysop am 2. November 2006 um 08:18 Uhr2006-11-02T08:18:55Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr style="vertical-align: top;" lang="de">
<td colspan="2" style="background-color: white; color:black; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: white; color:black; text-align: center;">Version vom 2. November 2006, 08:18 Uhr</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Zeile 1:</td>
<td colspan="2" class="diff-lineno">Zeile 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">{{Template:CleanupConfusing}}</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">{{Template:Technical}}</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">{{Template:Sprotected}}</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The page describes the steps needed to set up MediaWiki to use URLs without "index.php".   </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The page describes the steps needed to set up MediaWiki to use URLs without "index.php".   </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>WikiSysophttp://dadaweb.de/index.php?title=URL-K%C3%BCrzung&diff=3942&oldid=prevWikiSysop am 2. November 2006 um 08:18 Uhr2006-11-02T08:18:06Z<p></p>
<p><b>Neue Seite</b></p><div>{{Template:CleanupConfusing}}<br />
<br />
{{Template:Technical}}<br />
<br />
{{Template:Sprotected}}<br />
<br />
The page describes the steps needed to set up MediaWiki to use URLs without "index.php". <br />
<br />
For example:<br />
<br />
From:<br />
<br />
'''<nowiki>http://mywiki.site.tld/wiki/wiki/index.php?title=Article_name</nowiki>'''<br />
<br />
To:<br />
<br />
'''<nowiki>http://mywiki.site.tld/wiki/Article_name</nowiki>'''<br />
<br />
To eliminate even the "wiki" part, see [[Using a very short URL]].<br />
<br />
See also [[MediaWiki User's Guide]].<br />
<br />
==Getting URLs like those on Wikimedia sites==<br />
<br />
This method will put articles under: <br />
<br />
<nowiki>www.mysite.com/wiki/articlename</nowiki> <br />
and everything else under: <br />
<br />
<nowiki>www.mysite.com/w/index.php?whatever</nowiki> <br />
<br />
...just like the WikiMedia sites.<br />
<br />
Replace <nowiki>www.mysite.com</nowiki> and /filesystem/path/to/my/site to suit your site.<br />
<br />
===Using aliases in httpd.conf===<br />
<br />
This is the prefered method from a performance point of view, but requires access to edit httpd.conf; unfortunately, such access is unlikely in a shared hosting environment. It has been tested successfully with MediaWiki 1.4.4.<br />
<br />
1. In LocalSettings.php, make sure you are using these default values:<br />
<br />
$wgScriptPath = "/w";<br />
$wgScript = "$wgScriptPath/index.php";<br />
<br />
If you put the wiki installation in a subdirectory such as /w, use $wgScriptPath = "/w" as appropriate. <br />
<br />
If you put the files (such as index.php) in the root, you can use $wgScriptPath = "" in LocalSettings.php.<br />
<br />
2. In LocalSettings.php, set the following:<br />
<br />
$wgArticlePath = "/wiki/$1";<br />
<br />
'''Remember, the virtual directory for the wiki article space should never, ever overlap or hide real files. In particular it should never, ever overlap your base installation directory or the root directory. It can be a virtual subdirectory, such as /wiki.''' (For example: do not try to rewrite "<tt>/wiki/Article</tt>" to "<tt>/wiki/index.php?title=Article</tt>).<br />
<br />
3. Set up the following alias in your Apache httpd.conf. It can be in a <code>&lt;VirtualHost&gt;</code> section or in your general site config. In this alias, the prefix <code>/filesystem/path/to/my/site</code> represents the path you installed to &mdash; the directory where MediaWiki's <code>index.php</code> lives. Replace the prefix as appropriate for your actual file system path.<br />
<br />
#These must come last, and in this order!<br />
Alias /wiki /filesystem/path/to/my/site/index.php<br />
Alias /index.php /filesystem/path/to/my/site/index.php<br />
<br />
After making modifications to httpd.conf, you might have to restart Apache to apply the changes.<br />
<br />
Make sure Apache loads the Rewrite module. In httpd.conf this line must be added/uncommented:<br />
LoadModule rewrite_module modules/mod_rewrite.so<br />
<br />
After making modifications to httpd.conf, you might have to restart Apache to apply the changes.<br />
<br />
If you are using Apache 2, you might also need to turn on <code>[http://httpd.apache.org/docs-2.0/mod/core.html AcceptPathInfo]</code>. It is on by default in a standard installation of Apache and PHP, but some vendors/packagers may have it disabled on your system.<br />
<br />
===Using a rewrite rule in a .htaccess file===<br />
This method may be useful if you have the ability to use rewrite rules in .htaccess but don't have conf access. But this method is more work for the httpd.<br />
# install mediawiki in the dir for www.mysite.com/w as normal (using the installer)<br />
# set <code>$wgArticlePath = "/wiki/$1";</code> in LocalSettings.php<br />
# put a htaccess file with the following content in the dir for www.mysite.com<br />
# close the php security hole... <br />
# not actually needed but probably a good idea anyway<br />
php_flag register_globals off<br />
<br />
# first, enable the processing - Unless your ISP has it enabled<br />
# already. That might cause weird errors.<br />
RewriteEngine on<br />
<br />
# uncomment this rule if you want Apache to redirect from www.mysite.com/ to<br />
# www.mysite.com/wiki/Main_Page<br />
# RewriteRule ^/$ /wiki/Main_Page [R] <br />
<br />
# do the rewrite<br />
RewriteRule ^wiki/?(.*)$ /w/index.php?title=$1 [L,QSA]<br />
<br />
====Moving mediawiki to another directory====<br />
If you didn't follow the instructions and installed MediaWiki in the directory for www.mysite.com/wiki, then you will need to move it to another directory, such as "w". You will need to change the various paths (such as <tt>$IP</tt>) in <tt>LocalSettings.php</tt> to the new location.<br />
====Purging cache====<br />
<br />
If you notice that your changes to <code>$wgArticlePath</code> in LocalSettings.php are not being reflected in mysite.com/wiki/Main_Page, it may be due MediaWiki's caching of the links according to previous settings. <br />
<br />
Go to mysite.com/wiki/Main_Page?action=purge to force MediaWiki to regenerate the cached links. <br />
<br />
Also you can: <br />
# execute the MySQL query "DELETE FROM objectcache;", or <br />
# set <tt>$wgCacheEpoch</tt> to the current date.<br />
<br />
== Troubleshooting ==<br />
If you get internal server errors or similar, check out the Apache error.log. This usually has some clues about the reasons.<br />
<br />
== See also ==<br />
* [[MediaWiki i18n]] Localize/ customize things like the 'fromwikipedia' string<br />
* [[MediaWiki User's Guide]]<br />
See [[Talk:Eliminating index.php from the url|the talk page]] for more information on setting up non root rewrite rules.</div>WikiSysop