I am carrying out a book tutorial (Easy Ecommerce by Ray Ullman) to construct an ecommerce site. After I add the next code to my htaccess file to rewrite Web addresses as well as enforce SSL, it returns a 500 error after i attempt to load my website.

Does anybody have ideas exactly what the problem/solution may be?

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]



RewriteCond %{HTTPS} off RewriteRule ^(checkout\.php|billing\.php|final\.php|admin/(.*))$ https://%{HTTP_HOST}/$1 [R=301,L]

You will find some minor syntax errors inside your .htaccess. I've fixed them, please do this:

Options +FollowSymlinks -MultiViews
RewriteEngine on

# For sales:
RewriteRule ^shop/sales/?$ sales.php [L,NC]
# For the primary categories:
RewriteRule ^shop/([^/]*)/?$ shop.php?type=$1 [L,NC]
# For specific products:
RewriteRule ^browse/([^/]*)/([^/]*)/([0-9])/?$ browse.php?type=$1&category=$2&id=$3 [L,NC]
# For HTTPS pages:
RewriteCond %{HTTPS} off
RewriteRule ^(checkout\.php|billing\.php|final\.php|admin/(.*))$ https://%{HTTP_HOST}/$1 [R=301,L,NC]

Is Mod_Rewrite enabled inside your Apache configuration? Some companies don't activate it on shared hosts.

Also, take a look only at that page around the CodeIgnitor forums: http://codeigniter.com/forums/viewthread/86113/.

I believe the issue was what @sparky672 recommended within the comments, namely which i was copying and pasting and perhaps invisible figures snuck in

I acquired this to operate now

<IfModule mod_rewrite.c>
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]
</IfModule>

Where are you currently copying &lifier pasting it from?

If you are tugging them back an internet page, then you are presenting a myriad of invisible figures. If you are using MS Word, you are also presenting extraneous invisibles.

Use a great text editor, look for invisible junk and copy/paste after that. Or simply types full-scale lengthy-hands to your user interface editor.

Personally, I personally use a great text editor and upload via FTP (ensuring it's in ASCII text mode).