Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite code in htaccess causing 500 server error on ssl pages

         

windows

3:37 am on Mar 1, 2005 (gmt 0)

10+ Year Member



When I add rewrite code to the htaccess file it causes a 500 server error when a page using ssl is called in the browser, noe one seems to know whats causing it not even my host!

Options +FollowSymLinks
RewriteEngine On
RewriteBase /catalog/
RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}

windows

4:31 pm on Mar 1, 2005 (gmt 0)

10+ Year Member



Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@flat4online.co.uk and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

--------------------------------------------------------------------------------

Apache/1.3.29 Server at example.co.uk Port 443

[Tue Mar 1 10:46:22 2005] [error] [client 62.***.64.16] File does not exist: /home/scoty/example-www/favicon.ico
[Tue Mar 1 10:52:13 2005] [error] [client 195.**.67.66] File does not exist: /home/scoty/example-www/Pics/logo.JPG
[Tue Mar 1 10:52:13 2005] [error] [client 195.**.67.66] File does not exist: /home/scoty/example-www/Pics/Home.gif
[Tue Mar 1 10:52:13 2005] [error] [client 195.**.67.66] File does not exist: /home/scoty/example-www/Pics/About.gif
[Tue Mar 1 10:52:14 2005] [error] [client 195.**.67.66] File does not exist: /home/scoty/example-www/Pics/Ordering.gif
[Tue Mar 1 10:52:14 2005] [error] [client 195.**.67.66] File does not exist: /home/scoty/example-www/Pics/Contact.gif
[Tue Mar 1 10:52:14 2005] [error] [client 195.**.67.66] File does not exist: /home/scoty/example-www/Pics/Catalog.gif
[Tue Mar 1 10:52:14 2005] [error] [client 195.**.67.66] File does not exist: /home/scoty/example-www/Pics/Conditions.gif
[Tue Mar 1 10:52:14 2005] [error] [client 195.**.67.66] File does not exist: /home/scoty/example-www/Pics/paypal.JPG
[Tue Mar 1 10:52:15 2005] [error] [client 195.**.67.66] File does not exist: /home/scoty/example-www/Pics/logo_ccVisa.gif
[Tue Mar 1 10:52:15 2005] [error] [client 195.**.67.66] File does not exist: /home/scoty/example-www/Pics/logo_ccSwitch.gif
[Tue Mar 1 10:52:15 2005] [error] [client 195.**.67.66] File does not exist: /home/scoty/example-www/Pics/logo_ccMC.gif
[Tue Mar 1 10:52:15 2005] [error] [client 195.**.67.66] File does not exist: /home/scoty/example-www/Pics/logo_ccSolo.gif
[Tue Mar 1 10:52:15 2005] [error] [client 195.**.67.66] File does not exist: /home/scoty/example-www/Pics/view_cart.gif
[Tue Mar 1 10:52:15 2005] [error] [client 195.**.67.66] File does not exist: /home/scoty/example-www/Pics/header1.JPG
User not found ['scoty']
User not found ['scoty']
User not found ['scoty']
User not found ['scoty']
User not found ['scoty']
User not found ['scoty']
[Tue Mar 1 11:20:57 2005] [error] [client 207.**.98.149] File does not exist: /home/scoty/example-www/catalog/550cc-parts-p-84.html
User not found ['scoty']
User not found ['scoty']
User not found ['scoty']
User not found ['scoty']
User not found ['scoty']
User not found ['scoty']
User not found ['scoty']

[edited by: jdMorgan at 5:00 pm (utc) on Mar. 1, 2005]
[edit reason] Trimmed, removed specifics per TOS. [/edit]

jdMorgan

5:10 pm on Mar 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



windows,

Welcome to WebmasterWorld!

Please review our Terms of Service (link at bottom of page).

Without more information, I'm afraid we can't help you much. For example, is this path from your error log a valid path? Is it what you expect? If not, how does it differ from the correct path?

File does not exist: /home/scoty/example-www/Pics/Home.gif

Question #2. What does this mean to you?

User not found ['scoty']

If 'scoty' is the authentication name for SSL access, then obviously it is failing due to an authentication failure. In that case, the scripts can't run because the user they run under appears to be non-existent.

Sorry I can't offer anything more, but this appears to be a complex problem, and we'll need more information. Of course, the tough part is figuring out what is and is not relevant to the problem.

Jim

windows

9:43 pm on Mar 1, 2005 (gmt 0)

10+ Year Member



Hi Jim!

I changed some product titles/urls so I'm guessing the product not found are old links being clicked on still indexed by the search engines?

A fresh User not found ['scoty'] apears on the server error log every time I log view the log, modifying the htaccess file doesnt appear to generate this error but is it possible the two are connected?

When I first installed the contribution I had the same problem so I asked for some help and was advised that the server possibly needed rebooted for the installation of the htaccess file to be complete.
I contacted my host and they didnt sound too optomistic but they rebooted anyway and even tried installing the code themselves but it never made a difference.

So I have been using cName for the last few weeks and some of my new products names are too long but I cant make them any shorter, but rewrite will if only I could get it to work!
I'm 99% sure I am inserting the correct code in the correct place on the htaccess file.
I've been asking for answers on another forum for the last few weeks but no one seems to know whats causing it.
When mod_rewrite is on it works fine, the url's are much better its when re)write is on and "my account" or "checkout" is used on my site (they both use ssl) that the 500 server error occurs :(

jdMorgan

1:12 am on Mar 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't know if this will be of any help, but here is a possible temporary work-around. Maybe trying it will provide some more clues. This will disable the rewrites if a secure connection (port 443) is being used for the current HTTP request:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /catalog/
RewriteCond %{SERVER_PORT} ^443$
RewriteRule - [S=3]
RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING} [L]

If you have no other rules after these, you can change "[S=3]" to "[L]".

Jim

windows

9:29 am on Mar 2, 2005 (gmt 0)

10+ Year Member



Morning Jim tried that as soon as I woke up but it's not made any difference :(