This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Webmaster forum > September 2005 > debug mod_rewrite





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author debug mod_rewrite
Sig

2005-09-18, 11:22 pm

Is there a tool or a method to help debug mod_rewrite?

My immediate problem is that given

RewriteRule ^(.*)2z$ $0.jpg [L]
and http://example.org/3z.2z
I get "The requested URL /3z.2z.jpg was not found on this server."
I would expect to get /3z..jpg

--
Sig
(add three to my address to avoid spam filter)
John Bokma

2005-09-18, 11:22 pm

caff987@logsin.org (Sig) wrote:

> Is there a tool or a method to help debug mod_rewrite?
>
> My immediate problem is that given
>
> RewriteRule ^(.*)2z$ $0.jpg [L]

^
$1?
<http://httpd.apache.org/docs/2.1/mo...tml#rewriterule>
see beneath: "Here are all possible substitution combinations and their
meanings:"

--
John PERL SEO tools: http://johnbokma.com/perl/
Experienced (web) developer: http://castleamber.com/
Get a SEO report of your site for just 100 USD:
http://johnbokma.com/websitedesign/seo-expert-help.html
Sig

2005-09-18, 11:22 pm

On 19 Sep 2005 01:49:29 GMT, John Bokma <john@castleamber.com> wrote:

>caff987@logsin.org (Sig) wrote:
>
> ^
> $1?


It was the $0. Thank you.

(A tool, if there is one, would still be nice.)
--
Sig
(add three to my address to avoid spam filter)
Brian Wakem

2005-09-19, 7:20 am

Sig wrote:

> On 19 Sep 2005 01:49:29 GMT, John Bokma <john@castleamber.com> wrote:
>
>
> It was the $0. Thank you.
>
> (A tool, if there is one, would still be nice.)



Given that the regular regular expressions are largely PERL compatible, you
could easy test it with Perl.


$ PERL -e '$uri = "3z.2z"; $uri =~ s!^(.*)2z$!$1.jpg!; print "$uri\n";'

3z..jpg


--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews