httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Don Edmondson" <>
Subject RE: [users@httpd] - mod_rewrite question
Date Sat, 18 May 2013 13:09:30 GMT
Changed the RewriteCond to 

RewriteCond %{DOCUMENT_ROOT}/$1.shtml -f

...and now it is working (and the logic now makes sense to me :) !!!)

Thought (obviously incorrectly) I had read that when using .htaccess you
didn't need fully qualified paths.

Best Regards

-----Original Message-----
From: Eric Covener [] 
Sent: 18 May 2013 13:20
Subject: Re: [users@httpd] - mod_rewrite question

On Sat, May 18, 2013 at 6:11 AM, Don Edmondson
<> wrote:
> Don't know if I reply to the group or just to you?
>> > RewriteCond $1.shtml -f
>> This line doesnt make sense. What is $1 doing there what is it
> referencing?
>> >RewriteRule    ^(kgp[a-z0-9]*)\.html$  $1.shtml [PT]
> Sorry - not sure which line you are referring to - but, either way, it 
> makes perfect sense! It is a back-reference to the parenthesised 
> expression 'kgp[a-z0-9]*'. As an example - if the requested URI is 
> kgpwed.html then the RewriteCond is checking if kgpwed.shtml exists 
> and if it exists the RewriteRule causes it to be passed to the client
instead of kgpwed.html.
> This can be seen in the trace...
> With !-f
>  [perdir D:/xampp/htdocs/] RewriteCond: input='kgpwed.shtml' pattern='!-f'
> => matched

You should pass an absolute filesystem path to -f and -d.

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message