Page 1 of 1

configurable extension for url_rewrite

Posted: Mon 26. Jun 2006, 15:10
by kiwix
Hello,

i will suggest the following feature:

A new variable in the config.inc.php like:

$phpwcms["rewrite_ext"] = ".cms";

beside a small change in front.func.inc.php:

function url_search($query) {
if ( substr($query,0,4) == '?id=') {
$noid = substr($query, 4);
$file = str_replace(',', '.', $noid). $GLOBALS['phpwcms']["rewrite_ext"];
} else {
$noid = substr($query,1);
$file = str_replace(',', '.', $noid) . $GLOBALS['phpwcms']["rewrite_ext"];
}
$link = ' href="'.$file.'"';
return($link);
}

This will give anybody the possibilty to modifiy the extension from phtml to wcms (or whatever they want).

A small change to config.inc.php and the .htaccess and everything is possibe.

Does anyone (instead of me) would like to see that in the upcoming 1.27?

Cheers
KiWiX

Posted: Mon 26. Jun 2006, 15:37
by marcus@localhorst
hehe,
I would like to have a .cfm extension, because I'm a CFML programmer, but have no money to buy a CF server, so I could fake that :-/

I don't understand your intention, to change the extension.
but I think it's really a personal taste and most users don't need that.
And with your piece of code, everyone can do that.

an other would like to have 10+34+0+0+1.ext or 10/34/0/0/1 why not, but for the most users it should be ok to have the standard phpwcms rewritten phtml url.

(you need to suggest to, that each new extension like cms need to be parsed throught php!)

Code: Select all

AddHandler application/x-httpd-php .cms

Posted: Mon 26. Jun 2006, 15:54
by kiwix
> (you need to suggest to, that each new extension like cms need to be parsed throught php!)

No that's not correct. With phpwcms and an enabled mod_rewrite you can user every extension you want. At the moment it's fixed to phtml, which was the default extension of php2 applications (okay really old :-) )

Cheers
KiWiX

Posted: Mon 26. Jun 2006, 16:09
by marcus@localhorst
kiwix wrote:No that's not correct. With phpwcms and an enabled mod_rewrite you can user every extension you want. At the moment it's fixed to phtml, which was the default extension of php2 applications (okay really old :-) )
you are right! the mod_rewrite rewrite anything to the right file (index.php).
:-)

Posted: Mon 26. Jun 2006, 16:10
by pico
:?: what's wrong with .phtml

Posted: Mon 26. Jun 2006, 16:18
by juergen
:D whynot.asp

Posted: Mon 26. Jun 2006, 16:50
by pico
asp -> ActiveServerPages from M$ - this is another Technologie
OK this will start a neverending Discussion :?
I will Stop it from my side :D