Something similiar to the following should work:
NOTE 1: mod_rewrite rules should always go from the most specific at the top to the most general at the bottom. They are matched in order from top to bottom (and L does not always mean last in a .htaccess file).Code:## BEGIN host specific settings # Use PHP53 as default AddHandler application/x-httpd-php53 .php <IfModule mod_suphp.c> suPHP_ConfigPath /opt/php53/lib </IfModule> ## END host specific settings ## START Access control # Block access from these IP Addresses deny from 144.76.95.231 ## END Access control ## BEGIN the usual suspects # Enable mod_rewrite RewriteEngine On # Redirect all users to access the site WITH the 'www.' prefix RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteCond %{HTTP_HOST} !\.([a-z-]+\.[a-z]{2,6})$ [NC] RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] ## END the usual suspects ## BEGIN CEON URI MAPPING REWRITE RULE (folder "test") # ONLY rewrite URIs beginning with /test/ RewriteCond %{REQUEST_URI} ^/test/ [NC] # Don't rewrite any URIs ending with a file extension (ending with .[xxxxx]) RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC] # Don't rewrite any URIs for some, popular specific file format extensions, # which are not covered by main file extension condition above RewriteCond %{REQUEST_URI} !\.(mp3|mp4|h264)$ [NC] # Don't rewrite any URIs for some specific file format extensions, # which are not covered by main file extension condition above # Uncomment the following line to apply this condition! (Remove the # at the start of the next line) #RewriteCond %{REQUEST_URI} !\.(3gp|3g2|h261|h263|mj2|mjp2|mp4v|mpg4|m1v|m2v|m4u|f4v|m4v|3dml)$ [NC] # Don't rewrite admin directory RewriteCond %{REQUEST_URI} !^/test/admin [NC] # Don't rewrite editors directory RewriteCond %{REQUEST_URI} !^/test/editors/ [NC] # Don't rewrite !!storage directory RewriteCond %{REQUEST_URI} !^/test/logs/ [NC] # Handle all other URIs using Zen Cart (its index.php) RewriteRule .* test/index.php [QSA,L] ## END CEON URI MAPPING REWRITE RULE (folder "test") ## BEGIN CEON URI MAPPING REWRITE RULE (site root) # Don't rewrite the test folder RewriteCond %{REQUEST_URI} !^/test/ [NC] # Don't rewrite any URIs ending with a file extension (ending with .[xxxxx]) RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC] # Don't rewrite any URIs for some, popular specific file format extensions, # which are not covered by main file extension condition above RewriteCond %{REQUEST_URI} !\.(mp3|mp4|h264)$ [NC] # Don't rewrite any URIs for some specific file format extensions, # which are not covered by main file extension condition above # Uncomment the following line to apply this condition! (Remove the # at the start of the next line) #RewriteCond %{REQUEST_URI} !\.(3gp|3g2|h261|h263|mj2|mjp2|mp4v|mpg4|m1v|m2v|m4u|f4v|m4v|3dml)$ [NC] # Don't rewrite admin directory RewriteCond %{REQUEST_URI} !^/admin [NC] # Don't rewrite editors directory RewriteCond %{REQUEST_URI} !^/editors/ [NC] # Don't rewrite darkangel directory RewriteCond %{REQUEST_URI} !^/private/ [NC] # Don't rewrite cgi-bin directory RewriteCond %{REQUEST_URI} !^/cgi-bin/ [NC] # Handle all other URIs using Zen Cart (its index.php) RewriteRule .* index.php [QSA,L] ## END CEON URI MAPPING REWRITE RULE (site root) ## EXPIRES CACHING ## <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType application/pdf "access plus 1 month" ExpiresByType text/x-javascript "access plus 1 month" ExpiresByType application/x-shockwave-flash "access plus 1 month" ExpiresByType image/x-icon "access plus 1 year" ExpiresDefault "access plus 2 days" </IfModule> ## EXPIRES CACHING ##
NOTE 2: The above assumes the "live" store is installed at "/public/" (URL of /) and the "test" store is installed at "/public/test/" (URL of /test/).
NOTE 3: If multiple domain names point to the same web root, one may wish to use slightly different code for the FQDN redirect.


Reply With Quote

