Serendipity rewrite rules - what are some of them for?
Posted: Wed Jul 30, 2008 5:47 pm
I am trying to cleanup my rewrite rules a little bit, and I would like to understand them at the same time. And I have a few doubts...
a) What is the purpose of final rewrite
RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]
? It throws /every/thing/what/ends/with.html - unmodified - at index.php. Therefore those carefully tuned rules for /archives, and the rule for index.html, could be just omitted as they achieve the same....
b) What is the purpose of rewriting /htmlarea to /htmlarea ?
c) Why some rewrites use
index.php?/<url-here>
while others
index.php?url=<url-here>
Are those fully equivalent (seems so)?
d) Why unsubscribe is rewritten to url=/unsubscribe/... while
approve, delete and admin to url=approve/... and so on (no leading slash)?
e) Some rules are labeled with [NC] (non-case sensitive), some are not. Why?
f) Am I right thinking that - while having the default permalinks structure - I'd achieve equivalent result via simple
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html index.php?url=$1-article.html [L,QSA]
RewriteRule ^(.*) index.php?url=$1 [L,QSA]
(= replace title part with -article suffix in entries links, apart from that pass everything to index.php)
?
g) Is it possible to make it more strict? Does there exist some documentation about which urls is serendipity generating?
a) What is the purpose of final rewrite
RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]
? It throws /every/thing/what/ends/with.html - unmodified - at index.php. Therefore those carefully tuned rules for /archives, and the rule for index.html, could be just omitted as they achieve the same....
b) What is the purpose of rewriting /htmlarea to /htmlarea ?
c) Why some rewrites use
index.php?/<url-here>
while others
index.php?url=<url-here>
Are those fully equivalent (seems so)?
d) Why unsubscribe is rewritten to url=/unsubscribe/... while
approve, delete and admin to url=approve/... and so on (no leading slash)?
e) Some rules are labeled with [NC] (non-case sensitive), some are not. Why?
f) Am I right thinking that - while having the default permalinks structure - I'd achieve equivalent result via simple
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html index.php?url=$1-article.html [L,QSA]
RewriteRule ^(.*) index.php?url=$1 [L,QSA]
(= replace title part with -article suffix in entries links, apart from that pass everything to index.php)
?
g) Is it possible to make it more strict? Does there exist some documentation about which urls is serendipity generating?