.htaccess - htaccess : %{HTTP_HOST} not interpreted in redirect destination -


i'm trying setup redirections in htaccess file using tag %{http_host} in destination url not work.

example :

redirectpermanent /test http://%{http_host}/fr/news/test? 

i want use %{http_host} tag because want htaccess file work on local machine , on production server, without needing update htaccess.

in firefox, when enter http://www.example.com/test, address in address bar converted http://%{http_host}/fr/news/test, if tag not interpreted ! page remains white. in chrome, nothing happens, neither in address bar nor in page.

isn't possible use %{http_host} tag in destination of redirect ?

thanks help.

%{http_host} variable part of mod_rewrite, can not use in mod_alias,

try :

rewriteengine on   rewriterule ^test/?$ http://%{http_host}/fr/news/test? [l,r] 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -