[geeklog-devtalk] How to use url rewriting?
Tony Bibbs
tony at tonybibbs.com
Wed Apr 6 17:18:05 EDT 2005
Am I missing something on that URL? I didn't quite see an explanation.
Long and short of it is do we still have issues with rewriting and IIS? A
long time ago I remember testing this and I was seg faulting IIS by trying
to access one of the server variables that the rewrite depends on.
Also, I think it would be fine by me to modify the rewrite code to handle
IIS specially and I am also in favor of not supporting any other web
servers for rewriting other than IIS and Apache. I'm sure there will be
gripes here but you can always turn rewriting off.
For GL2, however, rewriting is a core feature that, frankly, needs to work
IMHO. Do we know which permuations of IIS/PHP don't work and does ISAPI
versus CGI make any difference?
--Tony
On Wed, April 6, 2005 4:07 pm, Blaine Lang said:
> Richard wrote:
> Wow, I didn't realize the rewrite code was reusable. When I setup my
> topic.php page, I copied and customized a small routine to accomplish the
> url rewrite. Blaine - remember our discussion about creating static links
> just for the
> topic index?
>
> I was testing these functions for this purpose in the forum last week and
> that's when I discovered the issue with IIS on certain platforms. There
> are
> several forum posts on geeklog.net as well regarding the staticpages
> plugin
> when URL_Rewrite is enabled. After several hours of digging, I posted my
> findings to this post on my site
> http://www.portalparts.com/forum/viewtopic.php?showtopic=4890&lastpost=true#4890
>
> ----- Original Message -----
> From: "Richard S. Westmoreland" <richardsw at suscom.net>
> To: <geeklog-devtalk at lists.geeklog.net>
> Sent: Wednesday, April 06, 2005 2:41 PM
> Subject: Re: [geeklog-devtalk] How to use url rewriting?
>
>
>
> ----- Original Message -----
> From: "Dirk Haun" <dirk at haun-online.de>
> To: <geeklog-devtalk at lists.geeklog.net>
> Sent: Wednesday, April 06, 2005 2:26 PM
> Subject: Re: [geeklog-devtalk] How to use url rewriting?
>
>
>> Dimitri,
>>
>> > * I'm not sure, but I think I have to use the function
>> > COM_buildURL(). This functions will then return a more readable
>> > url if url rewriting is enabeld. Is this all? Or is there about
>> it?
>>
>> Yes, that's all. You feed it with the URL you would use without
>> rewriting
>> and it either returns it unchanged (if rewriting is off) or "rewritten".
>>
>>
>> > * Who does the php scripts know what the rewritten url means?
>> > (/article.php?story=title doesn't look the same as
>> > /article.php/title) Is there more about it? Or does it just work?
>>
>> Have a look at code that uses it. For example, the static pages plugin
>> (staticpages/index.php):
>>
>> COM_setArgNames (array ('page', 'mode'));
>> $page = COM_applyFilter (COM_getArgument ('page'));
>> $mode = COM_applyFilter (COM_getArgument ('mode'));
>>
>> COM_setArgNames tells Geeklog that the first parameter in the URL is the
>> page and the second is the mode. The plugin then uses COM_getArgument to
>> actually request those parameters.
>>
>> This will work both with and without rewriting being activated.
>>
>> One important thing to notice is that the order of arguments will matter
>> now. So while myscript.php?foo=42&bar=0 and myscript.php?bar=0&foo=42
>> are
>> equivalent, this is no longer the case when using the URL rewriting
>> class. So make sure you always pass the parameters in the same order.
>>
>> bye, Dirk
>
> Wow, I didn't realize the rewrite code was reusable. When I setup my
> topic.php page, I copied and customized a small routine to accomplish the
> url rewrite.
>
> Blaine - remember our discussion about creating static links just for the
> topic index? That way the search engines would visit it more often in
> order
> to visit the threads. So based on Dirk's explanation, you could use
> already
> existing GL functions to accomplish it. So instead of
> www.portalparts.com/forum/index.php?&forum=2 it would be
> www.portalparts/forum/2.
>
> I better continue this conversation back at your site...
>
> Rick
>
>
> _______________________________________________
> geeklog-devtalk mailing list
> geeklog-devtalk at lists.geeklog.net
> http://lists.geeklog.net/listinfo/geeklog-devtalk
>
> _______________________________________________
> geeklog-devtalk mailing list
> geeklog-devtalk at lists.geeklog.net
> http://lists.geeklog.net/listinfo/geeklog-devtalk
>
More information about the geeklog-devtalk
mailing list