MikeMikeMike Posted May 14, 2011 Share Posted May 14, 2011 When I add the following code to my htaccess file according to the instructions starting at page 193, I'm getting a 500 error when I try to access my webpage. My web host hasn't been able to provide me with any answers. Any ideas? RewriteEngine on # For sales: RewriteRule ^shop/sales/?$ sales.php # For the primary categories: RewriteRule ^shop/([A-Za-z\ ] )/?$ shop.php?type=$1 # For specific products: RewriteRule ^browse/([A-Za-z\ \-] )/([A-Za-z\ \-] )/([0-9] )$ browse.php?type=$1&category=$2&id=$3 # For HTTPS pages: RewriteCond %{HTTPS} off RewriteRule ^(checkout\.php|billing\.php|final\.php|admin/(.*))$ https://%{HTTP_HOST}/$1 [R=301,L] Link to comment Share on other sites More sharing options...
MikeMikeMike Posted May 14, 2011 Author Share Posted May 14, 2011 it's working now. Problem might have been that some invisible characters were included from a copy and paste. Not sure Link to comment Share on other sites More sharing options...
Larry Posted May 14, 2011 Share Posted May 14, 2011 Glad it's working and thanks for letting us know. For future reference, with a question like this, a lot more details would be required to help solve the problem. Just an FYI. Link to comment Share on other sites More sharing options...
JBruner Posted February 19, 2013 Share Posted February 19, 2013 I am also getting an Internal 500 Error, and just cant seem to figure out why. I am copying the code straight from the printed book. When i don't have the .htaccess uploaded then the page shows up fine, but no links work. I would greatly appreciate any help. thank you! Here is the error: Internal Server Error The server encountered an internal error ormisconfiguration and was unable to completeyour request. Please contact the server administrator,webmaster@allthatteases.johnnybrunerdesigns.com and inform them of the time the error occurred,and anything you might have done that may havecaused the error. More information about this error may be availablein the server error log. Additionally, a 500 Internal Server Errorerror was encountered while trying to use an ErrorDocument to handle the request. Apache Server at www.allthatteases.com Port 80Here is my code: <IfModule mod_rewrite.c>RewriteEngine onRewriteCond %{HTTP_HOST} ^allthatteases\.comRewriteRule ^(.*)$ http://www.allthatteases.com/$1 [R=permanent,L]# For sales:RewriteRule ^shop/sales/?$ sales.php# For the primary categories:RewriteRule ^shop/([A-Za-z\+]+)/?$ shop.php?type=$1# For specific products:RewriteRule ^browse/([A-Za-z\+\-]+)/(A-Za-z\+\-]+)/([0-9]+)$ browse.php?type=$1&category=$2&id=$3# For HTTPS pages:RewriteCond %{HTTPS}offRewriteRule ^(checkout\.php|billing\.php|final\.php|admin/(.*))$ https://%{HTTP_HOST}/$1[R=301,L]</IfModule> Link to comment Share on other sites More sharing options...
Larry Posted February 20, 2013 Share Posted February 20, 2013 Generally when you have these 500 errors, there's no indication of which thing is causing the problem. I'd start by removing your two lines for redirecting to www. and see if that makes the error go away. If not, keep removing lines until the 500 error leaves, and then you've got the culprit. Link to comment Share on other sites More sharing options...
JBruner Posted February 21, 2013 Share Posted February 21, 2013 Thank you, I did that and it was the HTTPS cond statement and rewrite that was giving me the error Link to comment Share on other sites More sharing options...
Larry Posted February 22, 2013 Share Posted February 22, 2013 Okay. That's most likely because you don't have SSL setup on your server, then. Link to comment Share on other sites More sharing options...
Recommended Posts