apache - HTACCESS Redirect (moved folders) - Recursion Error -
i got ready made theme site. in need move images/js/css folder specific folder.
currently such:
|- application |- assets |- img |- css |- js |- system
the theme such the img/css/js folders int root folder.
with expectation route requests img/css/js folders wrote thing in .htaccess
file.
rewriteengine on rewritecond $1 !^(images|robots\.txt|assets) rewriterule img/(.*) /assets/img/$1 [l] rewriterule js/(.*) /assets/js/$1 [l] rewritecond %{request_uri} ^/system.* rewriterule ^(.*)$ index.php?/$1 [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.+)$ index.php?/$1 [l]
but noticed there recursion happening.
[fri may 03 11:56:46 2013] [error] [client 127.0.0.1] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace.
how avoid recursion. noticed changing folder name helps, prefer thing via .htaccess
.
i not regular expressions, remember there ways not in it. example saying redirect urls comming 'img' folder not having 'assets' in should redirected 'assets/img' folder.
btw, know how costly these .htaccess
rules performance wise. mean, bad idea have etc.
thanks in advance, , have nice day.
a rewrite condition gets applied following rule, need replicate condition both img , js rules:
rewritecond $1 !^(images|robots\.txt|assets) rewriterule img/(.*) /assets/img/$1 [l] rewritecond $1 !^(images|robots\.txt|assets) rewriterule js/(.*) /assets/js/$1 [l]
or can change pattern include beginning of uri:
rewriterule ^img/(.*) /assets/img/$1 [l] rewriterule ^js/(.*) /assets/js/$1 [l]
Comments
Post a Comment