Forum Moderators: phranque

Message Too Old, No Replies

Simple rewrite rule for CS Cart.

Simple rewrite rule for CS Cart.

         

CristianCSC

11:26 am on Jun 11, 2011 (gmt 0)

10+ Year Member



Hello,

I have a CS Cart e-commerce and my .htaccess looks like this:


DirectoryIndex index.html index.php

<IfModule mod_rewrite.c>
RewriteEngine on
Options +FollowSymLinks
# Some hostings require RewriteBase to be uncommented
# Example:
# Your store url is http://www.yourcompany.com/store/cart
# So "RewriteBase" should be:
# RewriteBase /store/cart
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !\.(png|gif|ico|swf|jpe?g|js|css)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php?sef_rewrite=1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} .*\/catalog\/.*
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteRule . index.php?sef_rewrite=1 [L,QSA]

</IfModule>


Now, I want to add a simple rewrite rule. I did several tests, and it seems that all my RewriteRule statements are ignored due to: RewriteRule . index.php?sef_rewrite=1 [L,QSA]

Any solution for having new rewrite rules? For example:
RewriteRule home index.php

Thank you in advance

g1smd

9:28 pm on Jun 11, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Put the new rule first. Add the [L] flag to it.

Be aware that .*\/catalog\/.* has several problems. The slash should NOT be escaped. Both .* parts are redundant. Use just /catalog/ instead.

The literal period in index.html should be escaped as index\.html in the RegEx pattern too.