brantics Posted February 22, 2016 Share Posted February 22, 2016 help!! I installed cubecart within a new folder of a site that's currently using wordpress so I could set it up. We've just assigned the domain name to the new directory and none of the links are working - home page works but all I'm getting when I click on my links is my webhosts 404 page. The code for the .htaccess is this: ##### START CubeCart .htaccess ##### <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)\.html?$ index.php?seo_path=$1 [L,QSA] </IfModule> ## 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 RewriteBase /cubecart/ ######## 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> ## Default store 404 page ErrorDocument 404 /cubecart/index.php ##### END CubeCart .htaccess ##### I've had my hosts looking at it and they're telling me they don't know anything about cubecart... soooo.... the cubecart directory is the one within the file. The site is crafteventsnz.co.nz and the directory it's been assigned to is crafteventsnz.co.nz/cubecart - in my host directory it's public_html/ca/cubecart... I have wordpress which has it's own .htaccess file installed in the /ca folder... but the domain has now been pointed to within the cubecart folder. I'm not a coder and desperately needs the site working properly!! Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 22, 2016 Share Posted February 22, 2016 The domain points to a folder, but that is irrelevant. (Such that your Wordpress domain also points to a folder. But again, that is irrelevant.) It is the URL that needs to be examined. The URL does NOT have a subfolder part to it. Therefore, the rewrite rule at the beginning of the .htaccess file is being interfered with by the rewrite section at the end of the file. Specifically, the RewriteBase directive. IF CubeCart was in a domain's subfolder, then RewriteBase would apply. That's not the case here. Delete the first ReWrite block at the top of the file. Change the RewriteBase directive to: RewriteBase / Once you get into admin, clear the cache (admin, Maintenance, Rebuild tab, Clear Cache). Quote Link to comment Share on other sites More sharing options...
brantics Posted February 22, 2016 Author Share Posted February 22, 2016 I've done that, the .htacess file now looks like this: ##### START CubeCart .htaccess ##### ## 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 RewriteBase / ######## 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> ## Default store 404 page ErrorDocument 404 /index.php ##### END CubeCart .htaccess ##### I've cleared the cache and it's still giving 404 errors I was told by a tech to Clear all custom defined SEO URL's Clear all auto generated SEO URL's as well which I did earlier... Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 22, 2016 Share Posted February 22, 2016 Ok, it seems that your hosting plan has an issue. The above .htaccess file has an ErrorDocument directive for 404 errors. Yet, that directive is not being honored. The document being returned is Bluehosts's 404 document. Therefore, I believe there must be a setting in your hosting plan's control panel (Cpanel?) for this domain that will enable Apache to use an .htaccess file. If I ask for this page:http://crafteventsnz.co.nz/index.php?_a=document&doc_id=1 I get a 302 Bounce (Moved Temporarily) to this page:http://crafteventsnz.co.nz/welcome.html This is CubeCart doing it's job of making sure the visitor enjoys SEO-friendly web addresses. So, CubeCart is working fine. Quote Link to comment Share on other sites More sharing options...
brantics Posted February 22, 2016 Author Share Posted February 22, 2016 thanks for having a look, I'll pass this onto my host and see what they say. One question though, I have a couple of other sites running cubecart with the same people and don't have any issues with those sites? if apache was wrong for this site wouldn't it be wrong for all of them? Quote Link to comment Share on other sites More sharing options...
brantics Posted February 22, 2016 Author Share Posted February 22, 2016 they're saying it's cubecart... they absolutely haven't a clue as to why it's not working... so now I guess I need a programmer? it shouldn't be this hard... Quote Link to comment Share on other sites More sharing options...
keat Posted February 22, 2016 Share Posted February 22, 2016 Is it not possible to disable the friendly SEO in Store Settings/Search Engines Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 22, 2016 Share Posted February 22, 2016 "If apache was wrong for this site wouldn't it be wrong for all of them?" I believe it's more along the lines of: If the Cpanel settings (or Apache VHOST configuration) for this domain was wrong, etc? If the solution is along the lines of a per domain name set of settings, then, yes, one could work, the other not. I still think it is a case of this domain name's Cpanel settings having the web server not engage the reading of the .htaccess file -- for the sole reason that the .htaccess file has a ErrorDocument directive that is not being honored. Is this a "shared server" hosting account? If so, it may be difficult to edit Apache's httpd.conf file. But, I think, in that file, you will want to see something like (the directory path will be specific to your situation): <Directory "E:/Inetpub/wwwroot"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Order allow,deny Allow from all </Directory> You will be wanting the AllowOverride All directive. Quote Link to comment Share on other sites More sharing options...
brantics Posted July 15, 2016 Author Share Posted July 15, 2016 Thank you, I got cubecart tech support to fix it for me, no idea how! Lol Quote Link to comment Share on other sites More sharing options...
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.