[SOLVED] 500 Internal server error when using the mod_rewrite
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
but on refresh, apache returns 500 Internal server error.
I looked on logs and found that :
Quote:
AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
Why that happens ? Mod_rewrite is enabled in httpd.conf.
AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
Why that happens ? Mod_rewrite is enabled in httpd.conf.
This happens because rewrite goes on loop.
you need a condition, so rewrite stops as soon as it meets. E.g:
Code:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/post.php
RewriteRule ^([^/]*)$ /post.php?id=$1 [L]
I don't understand what you're trying to do, but I guess you have to define the rewrite based on the original URI (/post.php or /cat.php), e.g.
It seems that reads .htaccess cause AllowOverride is setted to All. Now with that change, when i'm going to visit the link , server returns 404, Object not found.
It seems that reads .htaccess cause AllowOverride is setted to All. Now with that change, when i'm going to visit the link , server returns 404, Object not found.
Yup it reads it. The 404 error is because the URL /post.php?id=X is rewritten to /X and there is no such thing. So I guess that you just want to replace the actual query_string with a path made from it
If that's the case, assuming that post.php query_string accepts only numeric values, while cat.php accepts as first argument a string and as second a number, try the following
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.