Jump to content

Storefront hardlinks all gives 404 after fresh V6 installation


Recommended Posts

A friend of mine recommended CubeCart so installed V6 last night. Works like a charm.

But.

The hard-links on the storefront ("contact us", "Privacy policy", etc) all points to a *.html-file which does not exist, and the webserver says 404. The default document themselves exists in the admin-interface, but are not shown up.

The only plugin I've installed is the Kurouto-skin.

Any suggestions?

Link to comment
Share on other sites

 Been investigating this further now. I sent a mail to the hosting support but they have not yet replied.

 

However, to see if the <IfModule ...> in .htaccess was actually running, I entered some gibberish within the if-case and reloaded the page. Got HTTP Error 500 immediately, which means the mod_rewrite is loaded and running (else the if-case would have evaluated to false, no?)

 

I'm not into mod_rewrite, but as far as I can understand from .htaccess, it's the last line, the last RewriteRule that handles the case with *.html-files. Somehow this rule breaks, or does not work, since I get 404 for all of them. Since the installation is a fresh one, I surmise the rule itself bears no errors.

 

Yet it still induces errors. Somewhere. And I'm not that into WWW-projects that I'm able to track it down either, so I'm still clueless.

Link to comment
Share on other sites

Even more testing:

http://store.ribit.se/about-us.html  -> 404

Reading the rewrite-rule:

     RewriteRule ^(.*)\.html?$ index.php?seo_path=$1 [L,QSA]

So I'm manually rewriting the URL to:

http://store.ribit.se/index.php?seo_path=about-us

Which works.

And if I rename the keyword "RewriteRule" into "thingamajing", the server says HTTP Error 500. Which means the parser reads the RewriteRule, but somehow does not perform the actual rewrite.

I don't know what conclusions I can draw from this. Is the Rule broken?

Link to comment
Share on other sites

The server administrator can edit the file httpd.conf, which may have statements such as these:

<Directory /var/path/to/www>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

It seems the important one is AllowOverride All. The problem may come from the fact that there may be more web server configuration files that affect your site that have AllowOverride None.

So, if your site is on a "shared hosting server", you must wait for the server admins to get back to you.

If your hosting account is shared, and in your account's control panel you have access to a dedicated web configuration file (and can effectively reboot the web server), or your account is on a VPS, then make sure you have no web configuration file that is not allowing overrides.

Link to comment
Share on other sites

  • 4 weeks later...

Please check two things;

1. Make sure your server is Linux with Apache web server (with mod_rewrite)
2. Check there is a .htaccess file in the root folder of your store with code in. 

If the above two are satisfied all should be ok. 

​Al - I have just upgraded to CC6 and have the same problem. Please could you explain where .htaccess file lives in cpanel and provide a bit more detail (to a novice) so I can resolve this problem - thanks

Link to comment
Share on other sites

Your site uses the Litespeed webserver. Litespeed is able to use .htaccess files coded for Apache:

mod_rewrite

LiteSpeed Web Server's rewrite engine is fully compatible with Apache mod_rewrite so there is no need to change rewrite directives when you switch to LiteSpeed. The rewrite engine is highly optimized and increases speed over Apache's rewrite engine, especially for rewrite directives in a .htaccess file.

Visit Cubecart's admin, Store Settings, Search Engines tab. Just by doing so, CC6 will automatically write an appropriate .htaccess file where it needs to be (in the same folder where CubeCart is installed).

Using a file browser (commonly provided as a tool in the hosting control panel), find this file and make sure the contents contain at least:

#### Rewrite rules for SEO functionality ####
  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)\.html?$ index.php?seo_path=$1 [L,QSA]
Link to comment
Share on other sites

Hi

 
Thanks for your help...
 
 I've found the seo-htaccess.txt file ( I hope this is correct) in Cpanel settings
 
The content appears to contain the info you sent me yest. in the last paragraph.
 
Unsure what to do... My client's site is. http://www.wildtrout.com.au/store/index.php
Once I get the hard links working they are off and running.
Any advice?
 
chrs Paul
 
 
## 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>
Link to comment
Share on other sites

Much older versions of CubeCart (v5.1 era) is supposed to take the file you found (/admin/sources/settings/seo-htaccess.txt) and copy it to the root folder of CubeCart, naming it .htaccess.

CubeCart v6.0.4 has this same contents located inside the file, /classes/seo.class.php. Everytime CC6 starts, a check is made to make sure this file exists.

CubeCart's root folder also has index.php, admin.php, ini.inc.php, ini-custom.inc.php, README.md, several folders from /admin/ to /skins/, and a file named .htaccess.

Link to comment
Share on other sites

Hi, Thx for info... but still having trouble locating  v6.04. Found 

/public_html/store/classes/seo.class.php
 
But this seems to be v4. I saw 
#### Rewrite rules for SEO functionality ####
  RewriteEngine On

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

 

was in there. M/w all the site  hard links are now working , except when I test the shopping cart with BUY and try to go back home or other link get 404 again.
Scratching my head.

Link to comment
Share on other sites

Please check two things;

1. Make sure your server is Linux with Apache web server (with mod_rewrite)
2. Check there is a .htaccess file in the root folder of your store with code in. 

If the above two are satisfied all should be ok. 

​Al re item 2 - having trouble finding location of file in cpanel? any more details would be appreciated... thx

 

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