configurable extension for url_rewrite

Use GitHub to post feature requests for phpwcms.
Locked
kiwix
Posts: 65
Joined: Fri 25. Feb 2005, 09:40

configurable extension for url_rewrite

Post 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
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post 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
kiwix
Posts: 65
Joined: Fri 25. Feb 2005, 09:40

Post 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
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post 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).
:-)
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

:?: what's wrong with .phtml
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Post by juergen »

:D whynot.asp
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post 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
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
Locked