Jump to content

Upgrade 5.2.16 overwrite your .htaccess


Recommended Posts

The .htaccess file is used by the web server, specifically Apache and nginx(?), to contain certain statements and directives.

 

These directives tell the web server to make certain decisions and change certain aspects of the URL sent to it, among a long list of potential directives depending on what modules you have installed for the web server.

 

CubeCart's involvement is to take a URL that looks like:

store.com/friendly-name-of-a-product.html

and convert it to:

www.store.com/index.php?seo_path=friendly-name-of-product

 

CubeCart then has a piece of data it can work with to determine what actual product (or category, document, or other page) to show.

Link to comment
Share on other sites

## File Security
<FilesMatch ".(htaccess)$">
 Order Allow,Deny
 Deny from all
</FilesMatch>

#### Apache directory listing rules ####
DirectoryIndex index.php index.htm index.html
IndexIgnore *

#### Rewrite rules for SEO functionality ####

<IfModule mod_rewrite.c>
  RewriteEngine On

  ######## START v4 SEO URL BACKWARD COMPATIBILITY ########
  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule cat_([0-9]+)(.[a-z]{3,4})?(.*)$ index.php?_a=category&cat_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule prod_([0-9]+)(.[a-z]{3,4})?$ index.php?_a=product&product_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule info_([0-9]+)(.[a-z]{3,4})?$ index.php?_a=document&doc_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule tell_([0-9]+)(.[a-z]{3,4})?$ index.php?_a=product&product_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule _saleItems(.[a-z]+)?(?.*)?$ index.php?_a=saleitems&%1 [NC,L]
  ######## END v4 SEO URL BACKWARD COMPATIBILITY ########

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*).html?$ index.php?seo_path=$1 [L,QSA]
</IfModule>

so is that the wrong htaccess? I just upgraded and I cant tell. I would hate to have to pull a backup.

Link to comment
Share on other sites

so is that the wrong htaccess? I just upgraded and I cant tell. I would hate to have to pull a backup.

Not the "wrong" .htaccess file, it is a standard version. However, the point is (which has been made in previous posts as well) that if you have made changes to this (which ALL CubeCart installations should do !) then those changes will be lost when doing an upgrade. This file and the robots.txt files should not be part of a standard distribution

Ian

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...