Difference between revisions of "23 June 2007"
From Organic Design wiki
m |
(Change source-code blocks to standard format) |
||
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> | |
RewriteEngine On | RewriteEngine On | ||
RewriteCond %{REQUEST_URI} ^/$ | RewriteCond %{REQUEST_URI} ^/$ | ||
Line 7: | Line 7: | ||
RewriteCond %{REQUEST_URI} !^/(wiki|files)/ | RewriteCond %{REQUEST_URI} !^/(wiki|files)/ | ||
RewriteRule ^/(.*) /index.php/$1 [L] | RewriteRule ^/(.*) /index.php/$1 [L] | ||
− | </ | + | </source> |
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 | 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 | ||
Revision as of 16:54, 22 May 2015
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
- Friendly URL's - local article on our friendlt URL's
- MW:Manual:Short URL - MediaWiki's manual entry