I’m overseeing a move from one server to another, and on the new server it appears that our .htaccess file is now throwing off 500 Internal Server Errors. I assume there’s some kind of difference in settings between the two which would explain it, but the host hasn’t pinpointed anything yet.
Naturally, I began commenting things out until I found out what was causing it. This line appears to be the culprit:
RewriteRule (.*) index.php [O]
Does anyone know why this might be? Are there any settings that might interfere with this rule, perhaps?
I know of no flag that would/could use zero (or O, for that matter) so that’s one problem. The second problem is the one I rant about regularly: Using “lazy regex,” i.e., (.). Don’t you understand that (.) will match nothing or :kaioken:EVERYTHING :kaioken: INCLUDING index.php? Also, that mod_rewrite won’t quit until it cycles through your code WITHOUT a match?
To have a look at the tutorial in my signature. It’ll remove your “luddite” label and replace it with “guru.”
Whoa, ease up there, dk. I didn’t write this thing, and luddite though I may be, I understand that the (.*) will match everything. I’m just a little more focused on getting this site up and running than making it more efficient at the moment.
Anyway, thanks for the link, I’ll have a look.
Re: the zero. So, it’s a completely invalid command, then? That seems pretty odd…especially seeing as how it’s working fine on our other server! That seems awfully strange; anyone have any idea what the deal is?
Well, yikes, I don’t know what to tell you about looping, because whatever the reason, this line…
RewriteRule (.*) index.php [O]
…is running on a live site with no issues. I have no idea why, but I’ve triple-checked it, and it’s there and the site loads promptly.
By the by, we’re using Joomla along with ARTIO’s JoomSEF extension, and the part of the file with this line in it is headed with “Begin - Joomla! core SEF Section” and immediately followed by this line:
Hey now, no reason to keep getting excited. This isn’t my code and, being a layman I don’t know what’s necessary unless told. I’ll be glad to post the code; here are the lines preceding the loop: