Le 10/07/2013 00:18, Eric Covener a écrit :
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/mysite/pictures%{REQUEST_URI} -f
RewriteRule ^(.+) /mysite/pictures/$1 [L]
Unfortunately it doesn't work, because %{REQUEST_URI}contains also
/mysite...
Indeed if I request /mysite/icon.png, the input of
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 ^(.+)
Hi yvand,
Zitat von yvand yvand.sw...@gmail.com:
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
Thank you Jens-U. for your help.
I enabled log for URL rewriting, here is what I get if I request /icon.png
(DocumentRoot = /home/yvand/www)
127.0.0.1 - - [09/Jul/2013:14:41:28 +0200]
[localhost/sid#f884e0][rid#11f2bc0/initial] (3) [perdir
/home/yvand/www/] strip per-dir prefix:
Hi yvand,
may be because if you request /icon.png the first RewriteCond cannot find
the correct path.
Please try fix the rewritecond with this:
RewriteCond %{DOCUMENT_ROOT}/pictures%{REQUEST_FILENAME} -f
2013/7/9 yvand yvand.sw...@gmail.com
Hi all,
I want to redirect all requests like
It is quite weird... In your log it seems there isn't the rewritecond
part...
Which rewriteloglevel have you enabled?
2013/7/9 yvand yvand.sw...@gmail.com
Thank you Jens-U. for your help.
I enabled log for URL rewriting, here is what I get if I request /icon.png
(DocumentRoot =
Thank you Vincenzo D'Amore for helping me.
It is quite weird... In your log it seems there isn't the rewritecond
part...
Which rewriteloglevel have you enabled?
I used rewriteloglevel 3.
I changed it to 8 and noticed that it doesn't match as I expected !
With this htaccess :
RewriteEngine
It works fine with this RewriteCond :
RewriteCond %{DOCUMENT_ROOT}/pictures%{REQUEST_URI} -f
Thank you all for your help!
--yvand
-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands,
I got a new question.
Imagine my website is in a subfolder of document root's directory.
For example, document root is /home/yvand/www, and my website is in
/home/yvand/www/mysite.
How can I redirect URL like /mysite/icon.png to /mysite/pictures/icon.png ?
I tried to adapt .htaccess file so :
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/mysite/pictures%{REQUEST_URI} -f
RewriteRule ^(.+) /mysite/pictures/$1 [L]
Unfortunately it doesn't work, because %{REQUEST_URI}contains also
/mysite...
Indeed if I request /mysite/icon.png, the input of RewriteCond is
10 matches
Mail list logo