MikeW Posted July 26, 2011 Share Posted July 26, 2011 Had problems with .htaccess and navigating - worked through that by rewriting the .htaccess file This is what worked RewriteEngine on # For sales: RewriteRule ^shop/sales/?$ sales.php # For the primary categories: RewriteRule ^shop/([^/]*)/$ shop.php?type=$1 # For specific products: RewriteRule ^browse/([^/]*)/([^/]*)/([^/]*)$ browse.php?type=$1&category=$2&id=$3 Cart and wishlist handle perfect. When I type in the code to handle https - to make sure it's not a hidden character issue I get 500 errors all the time. I have an ssl certificate installed. RewriteCond %{HTTPS} off RewriteRule ^(checkout\.php(billing\.php|final\.php|admin/(.*))$ https://%(HTTP_HOST)/$1 [R=301,L] RewriteCond %(HTTPS) off RewriteRule ^(checkout\.php|billing\.php|final\.php|admin/(.*))$ https://%(HTTP_HOST)/$1 [R=301,L] If I uncomment either line I get the 500 error when loading any page. Running xammp 1.7.4 PHP 5.3.5 Apache 2.2.17 Mysql 5.5.8 Link to comment Share on other sites More sharing options...
Jonathon Posted July 27, 2011 Share Posted July 27, 2011 A quick guess, have you got SSL enabled in Xampp? Link to comment Share on other sites More sharing options...
Jonathon Posted July 27, 2011 Share Posted July 27, 2011 Sorry, if you have ssl installed I guess you're working on a live server. Link to comment Share on other sites More sharing options...
MikeW Posted July 27, 2011 Author Share Posted July 27, 2011 That is the default setting. Any hints to what I should be looking into. Or perhaps an alternate way to do that in .htaccess - even if it takes more lines Link to comment Share on other sites More sharing options...
Larry Posted July 27, 2011 Share Posted July 27, 2011 To confirm, is this all on one line in your .htaccess: RewriteCond %(HTTPS) off RewriteRule ^(checkout\.php|billing\.php|final\.php|admin/(.*))$ [url="https://%(HTTP_HOST"]https://%(HTTP_HOST[/url])/$1 [R=301,L] Because that should be two separate lines. Link to comment Share on other sites More sharing options...
MikeW Posted July 27, 2011 Author Share Posted July 27, 2011 Still same issue. Could I get the what to add to .htaccess for just one file. The checkout.php see if I can debug that - and expand on it. Other wise I will look for it myself. making ground but got stuck big time here. SSL is one and I am typing the lines as they appear in the forums to avoid hidden characters Link to comment Share on other sites More sharing options...
Larry Posted July 27, 2011 Share Posted July 27, 2011 Okay, looking more closely at what you wrote before, you have a repetition of the same two lines. So you need to fix that. Here's how you would enforce SSL for a specific file: RewriteCond %{HTTPS} off RewriteRule ^checkout\.php$ https://%(HTTP_HOST)/checkout.php [R=301,L] Also, there's a syntax error in your original code. You have another set of parentheses after "checkout.php", where it should be a | after checkout.php. Link to comment Share on other sites More sharing options...
MikeW Posted July 28, 2011 Author Share Posted July 28, 2011 That did it. Never could get the code for the standard redirects to work on xammp though. Even tried after I fixed everything else. But's it's working and it was a good learning experience. Link to comment Share on other sites More sharing options...
Recommended Posts