I was hired to install some ZenCart plugins recently one of which included the Simple SEO URL add on. The installation was fairly easy besides a dependency that was missing which I will describe in a future email. After the installation was complete I got excited when I was ready to test but was let down when I got a 500 Internal Server Error back from the Apache web server. The virtual host that the client was using didn’t have Error Logs enabled so I had to enable them and wait until they started archiving. Below is a description of the errors in the Apache Error Logs and how I resolved the issue.
500 Internal Server Error Caused By Simple SEO URL A ZenCart Addon:
- [Thu May 20 14:40:27 2010] [error] [client 192.168.1.26] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
- [Thu May 20 14:40:28 2010] [error] [client 192.168.1.26] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
I initially started to research using the LogLevel and LimitInternalRecursion settings in the .htaccess file that was doing the redirect but then I decided to poke around a bit first. The first place I happened to look was the .htaccess file which ended up being the issue. By default the .htaccess file that comes with Simple SEO URL includes /zencart/ as the RewriteBase as shown in the default .htaccess file.
Default .htaccess Of Simple SEO URL Add On For ZenCart:
- #### BOF SSU
- Options +FollowSymLinks -MultiViews
- RewriteEngine On
- # Make sure to change "test_site" to the subfolder you install ZC. If you use root folder, change to: RewriteBase /
- RewriteBase /zencart/
- # Deny access from .htaccess
- RewriteRule ^\.htaccess$ - [F]
- RewriteCond %{SCRIPT_FILENAME} !-f
- RewriteCond %{SCRIPT_FILENAME} !-d
- RewriteRule ^(.*) index.php?/$1 [E=VAR1:$1,QSA,L]
- #### EOF SSU
As you can see they even have a note that specifies you may have to modify the RewriteBase. So simply modify line 5 of the .htaccess to point to the root of your ZenCart site. In my case the ZenCart site is installed in the virtual host root so you would make the .htaccess point to “/” as shown in the below example image.
Modified .htaccess Of Simple SEO URL Add On For ZenCart:
- #### BOF SSU
- Options +FollowSymLinks -MultiViews
- RewriteEngine On
- # Make sure to change "test_site" to the subfolder you install ZC. If you use root folder, change to: RewriteBase /
- RewriteBase /
- # Deny access from .htaccess
- RewriteRule ^\.htaccess$ - [F]
- RewriteCond %{SCRIPT_FILENAME} !-f
- RewriteCond %{SCRIPT_FILENAME} !-d
- RewriteRule ^(.*) index.php?/$1 [E=VAR1:$1,QSA,L]
- #### EOF SSU
Now without having to restart the web server or anything attempt to visit pages on the site and more than likely things will be working properly now.The URL’s on your ZenCart site will now be much more Search Engine Optimized.