Post by Lido » Wed May 11, 2016 1:56 pm

I just installed 2.2.0.0 and it seems to be working. I have the default store data running with the default theme and layout. I enabled apache redirect. I copied .htaccess.txt to .htaccess and set ownership and permissions so apache can read the file. When I set seo URLs to "Yes" in the admin, all I get is 404 pages for everything I try other than the home page. If I select "no" seo URLs in the admin, the category links work fine but the URLs are not SEO friendly obviously. Any idea what causes the 404? Is there something in the apache file for the site directory that needs to be set to allow redirect or is there something that prevents it? I'm at a loss.
Last edited by Lido on Thu May 12, 2016 4:27 am, edited 1 time in total.

New member

Posts

Joined
Wed Mar 10, 2010 7:24 am

Post by IP_CAM » Thu May 12, 2016 2:11 am

two possible Causes for such:

1. you did NOT redirect the PATH/LINK in the .htaccess file correctly:

Code: Select all

# SEO URL Settings
# If your Shop installation does NOT run on the main web folder,
# make sure, your Shop-Folder/Directory does run in >RewriteBase / yourshopsubname/<
# one of them, by Example:

RewriteBase /
RewriteBase / shop/
RewriteBase / cart/
whereever your shop software is placed on the server !

2. you did NOT follow the Rules, by use of SEO multi word file titles,
instead of using, by Example:

Code: Select all

multi_word_file_titles
or:
multi-word-file-titles
or something similar, web-technically creating one word, out of them all, and without any White Space Gap in between !

Ernie

I am no longer active at the Forum. Please do NOT send me Personal Mails,
they will no longer be replied to.
My Github OC Site: https://github.com/IP-CAM
4'300 + FREE OC Extensions, on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Lido » Thu May 12, 2016 3:45 am

Thanks for the reply.

I am running opencart in the base directory of the site. Would it matter if my url is a subdomain? I'm using shop.mydomain.com as the url everywhere (apache config, ssl cert, store config etc).

So far I still have the default store data and layout going so I haven't changed any category to multi-word names. For example, when I click "Cameras" on the top navigation bar, I get a page that says:
Not Found
The requested URL /camera was not found on this server.
In the mysql "url_alias" table, this is the relevant line (which seems ok to me):

Code: Select all

 788 | category_id=33     | camera
As mentioned above, I have rewrite module enabled as far as I can tell on my server. In /etc/apache2/mods-enabled:

Code: Select all

rewrite.load -> ../mods-available/rewrite.load
…but for some reason it appears that .htaccess isn't being read.

New member

Posts

Joined
Wed Mar 10, 2010 7:24 am

Post by Lido » Thu May 12, 2016 4:46 am

The problem was in the sites-enabled config file for apache. I'm not sure why, but the directory section had to be edited to reflect the subdirectory where the site was stored on the server.

I changed this (sorry, but this forum is being touchy and blocking me so I had to substitute the "/" with "(slash)" and couldn't post the URL of the site that helped me:

Code: Select all

<Directory (slash)>
to:

Code: Select all

Directory (slash)var(slash)www
…and now it's working.

I found the info here:
search the famous q and a site for the question ".htaccess not being read" and look for the answer posted Aug 18, 2014 by Darren Cook.

New member

Posts

Joined
Wed Mar 10, 2010 7:24 am

Post by ermanoz » Sat May 08, 2021 5:33 am

When you will copy and paste this structure it s working

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

Newbie

Posts

Joined
Sun Jan 24, 2021 9:02 am
Who is online

Users browsing this forum: No registered users and 7 guests