Jump to content

Recommended Posts

Error message? Clues?  Apache version? OS Version? ???

 

Your rewrite rule appears to allow a situation where it would redirect the current URL and map this URL entirely onto the end of the new query string. Did you intend this? (e.g. /index.php?page=/docs/widgets/page=41 ???)

If all you want to do is append the page value then create a back-reference using RewriteCond and use this in the rewriterule to remap

 

I don't personally recommend .htaccess - see the Apache site for when and why http://httpd.apache.org/docs/2.0/howto/htaccess.html#when

Server error!

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

If you think this is a server error, please contact the webmaster.
Error 500
localhost
01/31/08 16:31:01
Apache/2.2.3 (Win32) DAV/2 mod_ssl/2.2.3 OpenSSL/0.9.8d mod_autoindex_color PHP/5.2.0 

 

This is the error that I had got.

It is highly likely that the mod_rewrite is not enabled. Find the following line in your httpd.conf and remove the # at the start of it. Stop and start your web server to get any changes made to httpd.conf to take effect -

 

Change this line -

 

#LoadModule rewrite_module modules/mod_rewrite.so

to this -

 

LoadModule rewrite_module modules/mod_rewrite.so

Have you tried commenting-out the rewrite rules to actually *prove* that these rules are the problem or are you assuming that they're the problem? If you've proven it is these two lines actually triggering the issue by the server working fine when commented out then there are other steps you can try.

Yes. I have commented out the httpd.conf and also commented out the code.

#RewriteRule ^(.*)$ /index.php?page=$1 [L]

 

Mysteriously, the below code works while the upper one don't.

 

RewriteRule ^(.+)$ /index.php?page=$1 [L]

 

Anyone can tell me what is the problem between (.*) and (.+)

The difference lies between 0 or more and 1 or more, not sure about the problem

I think you need to pinpoint the cause rather than simply making assumptions

 

I'd do a tail -f on the logs and watch what actual log entries happen for bother error and access logs for given URLs

One you can pinpoint an offending URL request which you can prove triggers the 500 error you can then analyse the logs and confirm the nature any connection between the rewrite rules and the error

 

You say you commented the httpd conf file but if .htaccess are in use have you checked to ensure that no other .htaccess file is triggering the error. You may need to search for all offending .htaccess files in the given search path.

 

See here for why .htaccess files in more than one folder may be referenced for any given request (and why I don't use them myself)

http://httpd.apache.org/docs/2.0/howto/htaccess.html#when

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.