bos Posted May 7, 2015 Posted May 7, 2015 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? Quote
bos Posted May 7, 2015 Author Posted May 7, 2015 Testing further, all links on the storefront are non-working. If i click a category, I get 404 as well. The store is (in no way complete) at http://store.ribit.se/ Quote
Al Brookbanks Posted May 7, 2015 Posted May 7, 2015 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. Quote
bos Posted May 7, 2015 Author Posted May 7, 2015 Linux + Apache, checkmod_rewrite, not sure. The domain is on a hosting server. How can I check if mod_rewrite is running?.htaccess, check. I've attached it. htaccess.txt Quote
Al Brookbanks Posted May 7, 2015 Posted May 7, 2015 Ask your server administrator or this might help: http://stackoverflow.com/questions/9021425/how-to-check-if-mod-rewrite-is-enabled-in-phpYou also might need to check the path in the .htaccess file to the index.php and make it root relative instead of document relative although this isn't normally needed. Quote
bos Posted May 7, 2015 Author Posted May 7, 2015 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. Quote
bos Posted May 8, 2015 Author Posted May 8, 2015 Even more testing:http://store.ribit.se/about-us.html -> 404Reading 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-usWhich 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? Quote
bsmither Posted May 8, 2015 Posted May 8, 2015 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. Quote
bos Posted May 8, 2015 Author Posted May 8, 2015 Problem solved by adding "RewriteBase /". Thanks for the tip! Quote
bsmither Posted May 8, 2015 Posted May 8, 2015 Well, glad it worked, but it makes no sense to me. Maybe your hosting support can explain why it was needed on your site. Quote
Al Brookbanks Posted May 8, 2015 Posted May 8, 2015 (edited) I've seen this a few times but I don't know why its required in some circumstances. To date I have only ever seen it translate to 404 errors never 500! Edited May 8, 2015 by Al Brookbanks Quote
Paul 0'Reilly Posted June 1, 2015 Posted June 1, 2015 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 Quote
bsmither Posted June 1, 2015 Posted June 1, 2015 Your site uses the Litespeed webserver. Litespeed is able to use .htaccess files coded for Apache:mod_rewriteLiteSpeed 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] Quote
Paul 0'Reilly Posted June 2, 2015 Posted June 2, 2015 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.phpOnce 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> Quote
bsmither Posted June 2, 2015 Posted June 2, 2015 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. Quote
Paul 0'Reilly Posted June 6, 2015 Posted June 6, 2015 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. Quote
Paul 0'Reilly Posted June 6, 2015 Posted June 6, 2015 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.