From: Shaun M. <sh...@ae...> - 2004-11-03 22:04:44
|
On 3 Nov 2004, at 21:12, Matthew McNaney wrote: > > > I like the example, and I can code support for it even though it still > requires Apache. Is there a noticeable difference in speed between > letting php parse the string and letting mod_rewrite compute the link? > I imagine it depends on the rules used. If there's significant regular expression matching then maybe a more targeted piece of PHP would be faster. > Is mod_rewrite unpopular? > More 'not standard' for cheaper hosting packages. > The site claims: > "Because doing mod_rewrite on sites with a lot of pages takes up a > large > amount of resources." > > Are they programming a rewrite on a per link basis? Currently 0.9.4 has > just one rule (although admittedly it is not very flexible). > I think it comes down to the regex. > >> Couldn't we just do this with a minor change in index.php? >> >> Add a stub in each module to encode / decode short urls and change >> each >> module as we go to call the functions to convert long urls to short >> ones. >> >> We could then even lose the index.php with a really simple mod_rewrite >> or forcetype rule rather than some massive list. > > I'll play around with this tomorrow. How about: > > www.site.com/index/pagemaster/action/view/id/4 > Better I suppose but I can't help thinking that the important info in that url is www.site.com/pagemaster/4 and the rest can be assumed for users. Even 'pagemaster' is a bit of an odd name. I'd like to see www.site.com/page4 > 'index' remains to call the file (is there a .htaccess hack to drop > this > as well?). Wouldn't you be able to replace index.php?module=pagemaster with pagemaster/ ?? > The first parameter after the index is always the module > (pagemaster). Then the script pipes the remaining parameters into > key/value pairs within GET and REQUEST. > > The moduleLink and secureLink functions can have a switch to deliver > the > links in this format or not automatically. > That's where to put it although not everybody uses moduleLink. Just a matter of getting people to change. One other thing that might be nice is some virtual links. For instance, I've an 'about' page at www.site.com/index.php? module=pagemaster&PAGE_user_op=view_page&PAGE_id=9 It'd be nice to be able to create a virtual link as www.site.com/about/ This is maybe a role for a separate module to create and manage these virtual links but perhaps it needs core help also. Shaun aegis design - http://www.aegisdesign.co.uk |