.htaccess - Htacces Apache END Flag alternative -
i wrote small framework (php) small projects, in should redirected index.php?path=$1, except defined paths. end flag not problematic. end flag exists still since apache 2.3 , script should work on apache 2.2 servers.
has idea how can realize without end flag?
rewriteengine on # define static redicts rewriterule ^image/(.+)$ public/image/$1 [end,qsa] rewriterule ^css/(.+)$ public/css/$1 [end,qsa] rewriterule ^js/(.+)$ public/js/$1 [end,qsa] rewriterule ^lib/js/core/(.+)$ core/lib/js/$1 [end,qsa] rewriterule ^lib/js/(.+)$ public/lib/js/$1 [end,qsa] rewriterule ^cache/(.+)$ public/cache/$1 [end,qsa] rewriterule ^download/(.+)$ public/download/$1 [end,qsa] # define custom redicts rewriterule ^page/([0-9]+)$ index.php?path=index.php&page=$1 [end,qsa] # define other redicts rewriterule ^(.+)$ index.php?path=$1 [l,qsa]
since of rules end end
flag, more or less want prevent looping of rewrite engine @ all. accomplish same thing without using end
flag, replace them l
flag , add passthrough rule @ beginning:
rewriteengine on # pass-through if rewrite rule has been applied rewritecond %{env:redirect_status} 200 rewriterule ^ - [l] # define static redicts rewriterule ^image/(.+)$ public/image/$1 [l,qsa] rewriterule ^css/(.+)$ public/css/$1 [l,qsa] rewriterule ^js/(.+)$ public/js/$1 [l,qsa] rewriterule ^lib/js/core/(.+)$ core/lib/js/$1 [l,qsa] rewriterule ^lib/js/(.+)$ public/lib/js/$1 [l,qsa] rewriterule ^cache/(.+)$ public/cache/$1 [l,qsa] rewriterule ^download/(.+)$ public/download/$1 [l,qsa] # define custom redicts rewriterule ^page/([0-9]+)$ index.php?path=index.php&page=$1 [l,qsa] # define other redicts rewriterule ^(.+)$ index.php?path=$1 [l,qsa]
Comments
Post a Comment