aPoLLo Posted July 23, 2014 Share Posted July 23, 2014 Hi guys and gals. Hope you are all doing well. I need some help please which relates to the Search Engines tab. Every time I enable SEO URLs the entire website stops working. When I click on a specific category or product I get the following error. "Not FoundThe requested URL /example.html was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request." Would somebody please advise as to why this is happening and offer a resolution? It would be much appreciate. I know I'm doing something wrong so your expertise will go a long way to assisting me with this issue. Cheers and thanks in advance. Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 23, 2014 Share Posted July 23, 2014 Two possibilities come to mind: 1. Your hosting account has a web server that does not use .htaccess files, or 2. You have not clicked on the "Install .htaccess" button. 1) The .htaccess file has the statements to rewrite the example.html part of the URL to read: index.php?seo_path=example and for these statements to work, the Apache webserver needs to have the mod_rewrite module installed for it. The mod_rewrite module is a very common add-on and if your webserver is Apache, that module will likely be there. There are other webservers - Nginex (very common), Abyss, Hiawatha, IIS (for Windows), etc. None but Apache uses the .htaccess file. Each of these webservers have their own way of rewriting the URL. 2) The latest versions of CubeCart come with the .htaccess file already located where it needs to be - in the main CubeCart folder. But if it is not, CubeCart will let you click a button to have a copy put in the main folder. But, .htaccess must already be there because CubeCart will not let you turn on seo mode if CubeCart can't find it. The 404 error is because the webserver is using example.html as is, without rewriting it as detailed above. Quote Link to comment Share on other sites More sharing options...
aPoLLo Posted July 23, 2014 Author Share Posted July 23, 2014 Thank you for your quick response to my problem bsmither. When I try to add the .htaccess file I receive the error inside Cubecart admin: *The following errors were detected: .Unable to update .htaccess file, please create it manually using an FTP client or web hosting filemanager. The .htaccess file was already located in the root. I backed up this file and the deleted it and tried again to add the file however, had the same resulting error. I finally created my own .htaccess file and uploaded it via FTP but when I activated the SEO URLs, I got the same problem where the website is renedered DOA. Any other suggestions? Cheers Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 23, 2014 Share Posted July 23, 2014 There must be at least these statements:#### Rewrite rules for SEO functionality #### <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> With respect to not being able to update, perhaps the file or the directory does not have the permissions needed for a PHP script to make such changes. Receiving the same error means that, even if the .htaccess file has the above statements, we still need to review point 1 above. You may need to consult with your hosting provider regarding: * Is your web server Apache? * If so, is mod_rewrite installed? * If not Apache, then what is the web server that is running your account? Quote Link to comment Share on other sites More sharing options...
aPoLLo Posted July 23, 2014 Author Share Posted July 23, 2014 I just checked and yes, mod_rewrite is installed and yes it is an Apache server. This is in the .htaccess file: # <rf> search engine friendly mod # 1) only used if you selected 'Apache directory lookback and ForceType supported' as your server configuration <Files shop> ForceType application/x-httpd-php </Files> # end 1) # 2) only used if you selected 'Apache RewriteRule supported' as your server configuration RewriteEngine On RewriteCond %{QUERY_STRING} (.+) RewriteRule cat_(.*).html index.php?act=viewCat&catId=$1&%1 [L] RewriteRule cat_(.*).html index.php?act=viewCat&catId=$1 [L] RewriteCond %{QUERY_STRING} (.+) RewriteRule prod_(.*).html index.php?act=viewProd&productId=$1&%1 [L] RewriteRule prod_(.*).html index.php?act=viewProd&productId=$1 [L] RewriteCond %{QUERY_STRING} (.+) RewriteRule info_(.*).html index.php?act=viewDoc&docId=$1&%1 [L] RewriteRule info_(.*).html index.php?act=viewDoc&docId=$1 [L] RewriteCond %{QUERY_STRING} (.+) RewriteRule tell_(.*).html index.php?act=taf&productId=$1&%1 [L] RewriteRule tell_(.*).html index.php?act=taf&productId=$1 [L] # end 2) # <rf> end mod RewriteCond %{HTTP_HOST} ^domain.com.au$ [OR] RewriteCond %{HTTP_HOST} ^www.domain.com.au$ RewriteRule ^/?$ "http://www.domain.com" [R=301,L] Makes no sense to me but this is what Cubecart suggests I use. Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 23, 2014 Share Posted July 23, 2014 Please let us know the exact version of CubeCart you are using. All of the prior discussion assumes the latest version of CubeCart v5. The contents of the .htaccess file in post #5 belongs to a third-party mod for CubeCart v3 (and maybe for early versions of CubeCart v4). Quote Link to comment Share on other sites More sharing options...
aPoLLo Posted July 24, 2014 Author Share Posted July 24, 2014 Hi again bsmither. Thanks for all your time. It is CC4. Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 24, 2014 Share Posted July 24, 2014 The forums at www.cubecartforums.org have a CC4 forum where there may be some information and/or assistance for CC4. I am not familiar enough with it to be able to answer how to get example.html to work. Quote Link to comment Share on other sites More sharing options...
Toucan Web Design Posted July 24, 2014 Share Posted July 24, 2014 Looks relatively fine, that .htaccess.. I'd just try the following: First off, remove these lines at the bottom and see if that sorts it out RewriteCond %{HTTP_HOST} ^domain.com.au$ [OR] RewriteCond %{HTTP_HOST} ^www.domain.com.au$ RewriteRule ^/?$ "http://www.domain.com" [R=301,L] If that does fix it, then it's a problem with those.. those are the only non standard bits on there I can see, might just be from a newer version of 4 I'm not familiar with Anyhow, if they're causing the issue, try switching them for this: RewriteCond %{HTTP_HOST} ^yourdomain.com.au$ [OR] RewriteCond %{HTTP_HOST} ^www.yourdomain.com.au$ [OR] RewriteCond %{HTTP_HOST} ^yourdomain.com$ RewriteRule ^(.*)?$ http://www.yourdomain.com/$1 [R=301,L] The backslashes should only need to be in front of those .'s. .. plus I'm not too sure what it's even trying to do.. seems to want to rewrite www and non www .. which is a bit odd for that sort of code, you're generally just writing them to one or the other, so only needs to trigger on the one. Edit: Ah right, nevermind, I see now, it's redirecting a com.au to a .com, got it. Ok.. changed the code accordingly Obviously you'll want to switch out the domain for the one of your site 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.