Jump to content

Resolved - Policy documents not opening


kab

Recommended Posts

For some reason, the policy documents are not opening in my Linux environment. They were opening in the windows (WAMP) environment quite fine. Any clue?

Ref. links to About Us, Terms & Conditions, Return Policy etc.

The requested URL /linking-policy.html was not found on this server.


The requested URL /login.html was not found on this server.


Does it have something to do with the SEO settings?

Also, upon executing Maintenance, an error pops up - "Failed to Build Sitemap". Now, I have set permissions for all the folders and sub-folders + files to rwx-rwx-rwx to make sure everything runs here. Any specific folder permissions which I need to undo or reset?

Edited by Dirty Butter
Additional information
Link to comment
Share on other sites

You must ensure there is an .htaccess file in the main CubeCart folder. There are important directives that make the web server cooperate with CubeCart in CC6's use of search-engine-friendly URLs.

You must ensure that mod_rewrite is enabled on your Linux server. If it is, then Apache (on the Linux server) may still have some restriction about the directives found in the ,htaccess file -- something about "relative paths". Please review this conversation.

I am not an expert at Linux folder/file permissions, but that is what the problem seems to be if CubeCart cannot build (more to the point, 'write') the sitemap to the file system.

FYI: Rebuilding the sitemap will also ping Google to come fetch it.

 

Link to comment
Share on other sites

I am curious to know if the browser is receiving an actual, factual 404 Not Found status from the web server, of if your browser is reporting:

"The requested URL /whatever.html was not found on this server."

as a friendly expression of something else that is actually happening.

A recently discovered bug will cause the browser to repeatedly ask for the same page if that page does not exist. For example:

www.example.com/no-such-seo-path-in-database.html

will have the browser keep asking for this page until the browser determines that something has gone wrong.

Link to comment
Share on other sites

The specific error which I get is the latter one - see below:

Not Found

The requested URL /terms-and-conditions.html was not found on this server.


Apache/2.4.7 (Ubuntu) Server at www.xxxxxxxxx.com Port 80
 
This is after I enabled the rewrite module in apache. This is also happening for the LOGIN & REGISTER links.
 
So I guess this is not a regular 404 but something else which I am overlooking. I reviewed the .htaccess (and also the thread). Did not see anything missing there. I guess the error started popping up after I changed permissions (which I have now reverted to full-access now).
Link to comment
Share on other sites

I would say that the error message is definitely coming from the web server and that it is the message the web server is being told to send (that is, there is a 404 Error Document located somewhere that Apache uses for a 404 status).

Here is a test. In the main folder of CubeCart, place this file there as well:

index.html

Contents:

<html><head><title>TEST!</title></head><body>Just a test.</body></html>

I assume that a request for index.php works fine. But if a request for www.your-domain.com/index.html returns something other than "Just a test.", then we can look at what Apache is being told about handling .html files.

Link to comment
Share on other sites

Hi Brian,

The test file is getting accessed from www.mydomain.com/test.html.

I am curious about the nature of permissions required for the folders and sub-folders in cubecart. I have a hunch that somewhere CC dynamically writes these htmls (you can confirm this) and these are either not getting written or getting read. I did a small experiment with the images folders (I was not able to load product images) and I changed the permissions to rwx-rwx-rwx for "images" and all its sub-folders. The images could be uploaded after that. The same issue with the /cache folder.

So, this leads me to believe that there is some dynamic content being generated which is not getting written and hence the error. Unfortunately I am unable to trace this path. Key issue is with the Product Description, Login, Register, About Us, Linking Policy, Terms & Conditions, Return Policy & Contact Us links on the homepage (almost about every html redirect link except javascript related code such as "add to basket" etc).

What would be interesting to know is where do these files get written to, so that I can try different permissions for those specific folders only.

Link to comment
Share on other sites

Hi Kab,

 

The data for the store documents is stored directly in the store database and called via php queries, so there is no file or folder to examine permissions here as such. 

I had some similar issues initially with CC6 which required a small bit of tweaking with the .htaccess file, I am unsure if this is the cause but if you want to post a copy of your current .htaccess file I am more than happy to take a look. If you could clarify if you are running http or https and if the store is located in a subdirectory also. e.g. https://mydomain.com/store

 

K

Link to comment
Share on other sites

Hello Kealan,

Here's a dump of the .htaccess (it is the default which I copied during the installation). I am running the store from the default root location i.e. http://www.mydomain.com/ and using http. I plan to move to https once I have this in place.

=====================

Options -Indexes


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

Hi Kab, 

In my admittedly limited experience I think there is an argument missing from the Options -Indexes line, Try replacing that line with the following 

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

 

Also I had to add 

RewriteCond %{SERVER_PORT} 80   just after the line ' RewriteEngine On ' 

I hope this is of some help 

K

Link to comment
Share on other sites

Hi Kealan,

I think the directory listing rules is already there in the original file - please see 7th line onwards. On the additional line you suggested, It did not work. I still get File Not Found for the likes of /login.html & /register.html (apart from others).

 

Link to comment
Share on other sites

Did a complete re-install; followed all the instructions given above; but still URLs not getting re-written. mod_rewrite is enabled. File/Folder rights set to full access to all. Flabbergasted! Can't even get to the login.html page.

 

Not Found

The requested URL /login.html was not found on this server.


Apache/2.4.7 (Ubuntu) Server at www.mydomain.com Port 80
Link to comment
Share on other sites

RESOLVED!

For those facing this issue - the resolution is to add the following lines in your apache2.conf (took me 2 days' research to get here :) )

<Directory /var/www/yourdomain.com/public_html> (assuming your files are stored in this path)
# Options Indexes FollowSymLinks
    Options FollowSymLinks    
    AllowOverride All
    Require all granted
</Directory>

Nothing else needs to be done (other than setting up the correct file/folder rights and ownerships for optimum security)

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