a mod_rewrite problem
i'm perplexing exercise following mod_rewrite rule:
host.com/developer/ => host.com/developer/index.py
host.com/developer/branchx => host.com/developer/index.py?branch=branchx
host.com/developer/branchx/commity => host.com/developer/index.py?branch=branchx&commit=commity
currently, suitable config domain looks this:
options followsymlinks
allowoverride none
rewriteengine on
rewriterule ^([^/]+)$ /$1/index.py [l]
rewriterule ^([^/]+)/([^/]+) /$1/index.py?branch=$2 [l]
rewriterule ^([^/]+)/([^/]+)/([^/]+)$ /$1/index.py?branch=$2&commit=$3 [l]
however, after url primarily rewritten, an middle route occurs url being rewritten again, ruining it. slight repeats times eventually law 500 error. record (timestamps perdir tools removed):
[..initial] (3) frame per-dir prefix: /home/www/host.com/master/a -> master/a
[..initial] (3) requesting settlement '^([^/]+)$' uri 'master/a'
[..initial] (3) frame per-dir prefix: /home/www/host.com/master/a -> master/a
[..initial] (3) requesting settlement '^([^/]+)/([^/]+)' uri 'master/a'
[..initial] (2) rewrite 'master/a' -> '/master/index.py?branch=a'
[..initial] (3) separate uri=/master/index.py?branch=a -> uri=/master/index.py, args=branch=a
[..initial] (1) middle route /master/index.py [internal redirect]
[..initial/redir#1] (3) frame per-dir prefix: /home/www/host.com/master/index.py -> master/index.py
[..initial/redir#1] (3) requesting settlement '^([^/]+)$' uri 'master/index.py'
[..initial/redir#1] (3) frame per-dir prefix: /home/www/host.com/master/index.py -> master/index.py
[..initial/redir#1] (3) requesting settlement '^([^/]+)/([^/]+)' uri 'master/index.py'
[..initial/redir#1] (2) rewrite 'master/index.py' -> '/master/index.py?branch=index.py'
[..initial/redir#1] (3) separate uri=/master/index.py?branch=index.py -> uri=/master/index.py, args=branch=index.py
how i repair manners hinder spontaneity middle redirects?
thanks.
Comments
Post a Comment