Results 1 to 10 of 2445

Threaded View

  1. #11
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Ceon URI Mapping v4.x

    Something similiar to the following should work:

    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 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).

    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.
    Last edited by lhungil; 14 Apr 2015 at 04:51 AM.
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

 

 

Similar Threads

  1. v139d Ceon uri mapping, how to generate uri mapping for bulk bulk-imported products?
    By mybiz9999 in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 8 Jan 2013, 06:52 AM
  2. CEON URI Mapping
    By jmkent in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 22 Nov 2012, 04:28 PM
  3. Ceon URI Mapping (SEO)
    By conor in forum All Other Contributions/Addons
    Replies: 2906
    Last Post: 9 Sep 2011, 08:31 AM
  4. Ceon URI Mapping v4
    By conor in forum All Other Contributions/Addons
    Replies: 110
    Last Post: 14 Aug 2011, 02:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR