Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

RewriteCond Help

 
   Web Hosting Problem Solving Community! (Home) -> Apache RSS
Next:  pls help with iisstate dump file analysis  
Author Message
trevordixon

External


Since: Dec 28, 2005
Posts: 2



(Msg. 1) Posted: Thu Jan 12, 2006 6:46 pm
Post subject: RewriteCond Help
Archived from groups: alt>apache>configuration (more info?)

What the heck is wrong with this?

RewriteEngine On
RewriteCond %{REQUEST_URI} !-f
RewriteRule ^/([^/.]+)\.html$ /test.php?filename=$1 [L]


It's rewriting EVERY request, even for files that do exist. When I try
-f instead of !-f, it doesn't rewrite any requests. I've also tried -F,
!-F, %{REQUEST_FILENAME}, and every combination of the mentioned
possibilites and every time I use the ! it rewrites everything, and
without the ! it won't rewrite anything. What's going on?

 >> Stay informed about: RewriteCond Help 
Back to top
Login to vote
Robert Ionescu

External


Since: Nov 10, 2005
Posts: 21



(Msg. 2) Posted: Fri Jan 13, 2006 5:55 pm
Post subject: Re: RewriteCond Help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

trevordixon.DeleteThis@gmail.com wrote:
> What the heck is wrong with this?
>
> RewriteEngine On
> RewriteCond %{REQUEST_URI} !-f
> RewriteRule ^/([^/.]+)\.html$ /test.php?filename=$1 [L]

REQUEST_FILENAME should be th right ENV, you must check -f against a
full physical path like /var/www/htdocs/123.html

Did you setup a RewriteLog with RewriteLogLevel 5? You should see the
value of that variable there.

If the value of REQUEST_FILENAME is empty, try an internal sub request

RewriteCond %{LA-U:REQUEST_FILENAME} !-f
RewriteRule ^/([^/.]+)\.html$ /test.php?filename=$1 [L]

--
Robert

 >> Stay informed about: RewriteCond Help 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]