apache - RewriteRule htaccess issue -


i have live-cams.php file in root directory of project , try rewrite link /live-cams

rewriterule ^live-cams ./live-cams.php [nc,l] 

this rule throw

500 internal server error error encountered while trying use errordocument handle request.

also throw same error when try open file /live-cams.php. rule index.php looks live-cams.php , work well

rewriterule ^home ./index.php [nc,l] 

when type friendly link ^live-cams/ instead of ^live-cams works.

apache error log:

[fri aug 18 12:20:38.011915 2017] [core:error] [pid 14024:tid 1920] [client ::1:58474] ah00124: request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace.

anyone know whats wrong?

you need use anchors in regex pattenrs:

rewriterule ^live-cams/? live-cams.php [nc,l]  rewriterule ^home/?$ index.php [nc,l] 

otherwise live-cams part of original , rewritten uris causing mod_rewrite keep executing rules until hits limitinternalrecursion count.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -