httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jens-U. Mozdzen" <>
Subject Re: [users@httpd] Issue with URL Rewriting
Date Tue, 09 Jul 2013 13:39:53 GMT
Hi yvand,

Zitat von yvand <>:
> Hi all,
> I want to redirect all requests like /icon.png to  
> /pictures/icon.png, if the file exists in the pictures folder.
> It seems really trivial but I didn't manage to set up.
> Here is my .htaccess :
>     RewriteEngine On
>     RewriteCond /pictures/%{REQUEST_FILENAME} -f
>     RewriteRule ^(.+) /pictures/$1 [L]
> If I request /pictures/icon.png it works, but if I request /icon.png  
> I get a 404 error.
> What is wrong with my .htaccess?

as you are in .htaccess (and not in global server/vhost context), I'd  
expect REQUEST_FILENAME to be the full path of the resource. From :

"The full local filesystem path to the file or script matching the  
request, if this has already been determined by the server at the time  
REQUEST_FILENAME is referenced."

You may want to set up mod_rewrite logging  
( to  
verify this... the logging is generally *very* helpful in debugging  
such problems.


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

View raw message