https://www.noisebridge.net/index.php?title=User:Endenizen/URL_Rewriting&feed=atom&action=historyUser:Endenizen/URL Rewriting - Revision history2024-03-28T09:34:10ZRevision history for this page on the wikiMediaWiki 1.39.4https://www.noisebridge.net/index.php?title=User:Endenizen/URL_Rewriting&diff=1478&oldid=prevEndenizen: New page: === URL Stuff for noisebridge wiki === '''LocalSettings.php in /wiki''' <code>$wgScriptPath</code> should already be defined. Wiki should be installed/moved to the /wiki dir. (first two ...2008-10-08T00:28:47Z<p>New page: === URL Stuff for noisebridge wiki === '''LocalSettings.php in /wiki''' <code>$wgScriptPath</code> should already be defined. Wiki should be installed/moved to the /wiki dir. (first two ...</p>
<p><b>New page</b></p><div>=== URL Stuff for noisebridge wiki ===<br />
<br />
'''LocalSettings.php in /wiki'''<br />
<br />
<code>$wgScriptPath</code> should already be defined. Wiki should be installed/moved to the /wiki dir. (first two lines may be optional)<br />
<br />
$wgScript = "$wgScriptPath/index.php";<br />
$wgRedirectPath = "$wgScriptPath/redirect.php";<br />
$wgArticlePath = "/wiki/$1";<br />
<br />
'''.htaccess in /wiki'''<br />
<br />
Verifies that we're not trying to access an actual file, then passes us off to the wiki script.<br />
<br />
RewriteEngine On<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule (.*)$ index.php?title=$1<br />
<br />
'''.htaccess in /'''<br />
<br />
Redirects us to the /wiki article if there is a '/' on the end of index.php or to an edit page if it finds a query string (ie: if we saved a link to an edit page with the old scheme, it should work just fine with the new scheme).<br />
<br />
RewriteEngine On<br />
RewriteRule ^index.php/(.+)$ /wiki/$1 [R]<br />
RewriteCond %{QUERY_STRING} !=""<br />
RewriteRule ^index.php$ /wiki/index.php [R,QSA]</div>Endenizen