diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-01-12 11:53:31 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-01-12 11:53:31 +0000 |
commit | 7d677b5c5a05f3594c10f2cac14ffe3b368e2204 (patch) | |
tree | 31221af29f8cc546919c457c58d3e499c3575def | |
parent | 97f4bdb9457331d32aefffc2b9f27f0339a020f1 (diff) | |
download | brdo-7d677b5c5a05f3594c10f2cac14ffe3b368e2204.tar.gz brdo-7d677b5c5a05f3594c10f2cac14ffe3b368e2204.tar.bz2 |
- Added some more URL rewrite rules based on contributions from Gerhard.
-rw-r--r-- | includes/common.inc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/includes/common.inc b/includes/common.inc index 0d828b73d..d223371c8 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -476,14 +476,19 @@ function rewrite_old_urls($text) { /* ** This is a *temporary* filter to rewrite old-style URLs to new-style ** URLs (clean URLs). Currently, URLs are being rewritten dynamically - ** (ie. "on output"), however When these rewrite rules have been tested - ** enough, we will use them to permanently rewrite the links in node + ** (ie. "on output"), however when these rewrite rules have been tested + ** enough, we will use them to permanently rewrite the links in node ** and comment bodies. */ - // rewrite 'node.php?id=<number>[&cid=<number>]' + // rewrite 'node.php?id=<number>[&cid=<number>]' style URLs: $text = eregi_replace("(node)\.php\?id=([[:digit:]]+)(&cid=)?([[:digit:]]*)", "?q=\\1/view/\\2/\\4", $text); - + + // rewrite 'module.php?mod=<name>{&<op>=<value>}' style URLs: + $text = ereg_replace("module\.php\?(&?[[:alpha:]]+=([[:alnum:]]+))(&?[[:alpha:]]+=([[:alnum:]]+))(&?[[:alpha:]]+=([[:alnum:]]+))", "?q=\\2/\\4/\\6" , $text); + $text = ereg_replace("module\.php\?(&?[[:alpha:]]+=([[:alnum:]]+))(&?[[:alpha:]]+=([[:alnum:]]+))", "?q=\\2/\\4" , $text); + $text = ereg_replace("module\.php\?(&?[[:alpha:]]+=([[:alnum:]]+))", "?q=\\2" , $text); + return $text; } |