Getting rid of error 500

Noor

Administrator
Staff member
Often, when developing a website, we are faced with the problem of CNC (Human Understandable Url).
This article provides an option to resolve the 500 Internal Server Error.
I also tried this mistake on my bell tower, my brain boiled many times and finally “the good people kicked it in the direction of the south.”
The point is that mod_rewrite “searches” for a suitable template for our request until it gets the one we need, endlessly (at least on hosts there is usually a timeout, due to which the 500 error is triggered), but with a little trick we can eliminate this issue.
LET'S GET STARTED:

Code:
RewriteEngine On
RewriteBase /
RewriteCond %{ENV:REDIRECT_FINISH} !^$
RewriteRule ^ - [L]
#Then there are as many rules as you like
RewriteRule ^/?([a-z]+)$ /router.php?page=$1 [E=FINISH:1,L,QSA]

Thus, the rewrite module will not fire endlessly because it will encounter E=FINISH and the REDIRECT_ rule will work.
I ask you not to kick too hard, but to those who helped, thanks are accepted
 
Back
Top