httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Don Edmondson" <don.edmond...@kg-enterprises.com>
Subject RE: [users@httpd] users@httpd.apache.org - mod_rewrite question
Date Sat, 18 May 2013 13:09:30 GMT
THANK YOU!
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
Don 


-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com] 
Sent: 18 May 2013 13:20
To: users@httpd.apache.org; don.edmondson@kg-enterprises.com
Subject: Re: [users@httpd] users@httpd.apache.org - mod_rewrite question

On Sat, May 18, 2013 at 6:11 AM, Don Edmondson
<don.edmondson@kg-enterprises.com> 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: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message