Difference between revisions of "23 June 2007"

From Organic Design wiki
(Change source-code blocks to standard format)
m
 
Line 1: Line 1:
 
{{news|title=OD's URL's get slightly friendlier|img=|msg=
 
{{news|title=OD's URL's get slightly friendlier|img=|msg=
 
Our [http://httpd.apache.org/docs/mod/mod_rewrite.htmlrewrite Mod-Rewrite] rules have been updated today to allow them to become even more [[MW:Manual:Short_URL|friendly]] by not appending any page name to the URL when requests are made to the naked domain name. The new rules are as follows:
 
Our [http://httpd.apache.org/docs/mod/mod_rewrite.htmlrewrite Mod-Rewrite] rules have been updated today to allow them to become even more [[MW:Manual:Short_URL|friendly]] by not appending any page name to the URL when requests are made to the naked domain name. The new rules are as follows:
<source>
+
<source lang="apache">
 
RewriteEngine On
 
RewriteEngine On
 
RewriteCond %{REQUEST_URI} ^/$
 
RewriteCond %{REQUEST_URI} ^/$

Latest revision as of 17:32, 22 May 2015

Warning.svg This is a blog item that needs to be converted to the new Bliki format


OD's URL's get slightly friendlier

Our Mod-Rewrite rules have been updated today to allow them to become even more friendly by not appending any page name to the URL when requests are made to the naked domain name. The new rules are as follows:

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^/(.*) /index.php/Main_Page [L]
RewriteCond %{REQUEST_URI} !^/(wiki|files)/
RewriteRule ^/(.*) /index.php/$1 [L]

The first condition and rule pair handles requests to the naked domain name and rewrites the to Main_Page so that the URL doesn't get appended with the "Main Page" name. The second pair says not to touch any URL's which start with /wiki/ or /files/, this protects all old-style article requests, and requests to internal MediaWiki files like scripts or images. It also allows other directories of web documents outside the wiki such as http://www.organicdesign.co.nz/files/od/media

See also