Post by Crumpy1 » Sun Aug 21, 2016 6:44 pm

Hi All,

I have searched the forum high and low, but unfortunately, I could not find the answer to this question, so apologies if it has already been answered or is painfully obvious.

I am trying to change the index.php?route=product/product&path=61&product_id=53 section of each product to be more SEO friendly by using store/product-name.html instead. Is this possible? I am used to using Magento but I find that it is too temperamental and changing something causes errors elsewhere, so I am trying to find my way around Opencart as my new permanent solution but cannot find how to use the SEO URL value over the product id.

Is this even possible?

Each product has been given an SEO URL value in the data section of the product creation page, but I still get the product id=53 in the URL on the frontend.

Any help, even if it means purchasing an extension would be greatly appreciated.

Thank you.

Newbie

Posts

Joined
Sun Aug 21, 2016 6:33 pm

Post by labeshops » Sun Aug 21, 2016 7:41 pm

If you have seo urls properly enabled, you should not see the product id. Sounds like you have a configuration problem.

Which version of opencart are you using? You say you gave all products seo urls, but did you rename htaaccess.txt to .htaaccess and turn on seo urls in settings?

Running Opencart v3.0.3.2 with multi-stores from https://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by Crumpy1 » Sun Aug 21, 2016 11:11 pm

Hi Labeshops,

Thanks for the info, I did not turn on the SEO URLs in the general settings. I wondered why these we not working ;D

This led to a 404 error though on every product so I double checked the .htaccess file. I changed the .htaccess file after I installed but it remained as a .txt file, so I have just changed it to a .htaccess file which now sends me back to the xampp dashboard, no matter what product I click.

If SEO URL is turned off though it does work fine but goes back to the product ID so i am guessing the error is there somewhere.

Is there a way to fix this error do you know ???

I am using version 2.3.0.2 BTW.

Thanks

Newbie

Posts

Joined
Sun Aug 21, 2016 6:33 pm

Post by fido-x » Sun Aug 21, 2016 11:21 pm

Crumpy1 wrote:... I have just changed it to a .htaccess file which now sends me back to the xampp dashboard, no matter what product I click.
It would seem that your store is located in a sub-folder of your XAMPP installation. Set the RewriteBase in your .htaccess to point to that sub-folder, e.g.:

Code: Select all

RewriteBase /sub-folder/

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Crumpy1 » Mon Aug 22, 2016 12:43 am

Hi fido-x,

Apologies if the answer is obvious.

my store is located in root/ocart/(store files)

the URL SEO Link goes to http://127.0.0.1/PCM/ocart/upload/fully ... e-commerce as an example.

I have amended the .htaccess file with the following:

Code: Select all

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

RewriteBase /ocart/
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/download/(.*) 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]
But the Object Not Found! 404 Error still occurs.

Did I do something wrong?? :-\

Newbie

Posts

Joined
Sun Aug 21, 2016 6:33 pm

Post by fido-x » Mon Aug 22, 2016 12:56 am

In your XAMPP installation folder, you'll find another folder called "htdocs", this is your "root", i.e. http://127.0.0.1/ (you could also use "localhost" instead of the IP address, e.g. http://localhost/). The RewriteBase starts at the root (/).
Crumpy1 wrote:the URL SEO Link goes to http://127.0.0.1/PCM/ocart/upload/fully ... e-commerce as an example.
From this, I would hazard a guess that your RewriteBase should be:

Code: Select all

RewriteBase /PCM/ocart/upload/
Although URLs do not differentiate between uppercase and lowercase letters (they are treated the same).

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Crumpy1 » Mon Aug 22, 2016 12:59 am

Thank you for spotting the error. Your "guess" was bang on! Works like a charm now.

Many thanks, i doubt i would have spotted that anytime soon without your help.

Newbie

Posts

Joined
Sun Aug 21, 2016 6:33 pm

Post by Crumpy1 » Sat Oct 15, 2016 5:19 pm

Hi fido-x,

I have just uploaded the store to the server but again this annoying 404 error occurs.

Temp URL for the store: http://gator4253.hostgator.com/~crumpy360/store/upload/

I have amended the .htaccess file to the new sub-directory which I believe should be:

Code: Select all

RewriteBase  /home3/crumpy360/public_html/store/upload/
For reference - the automatically generated config files states the platform directory should be:

Code: Select all

define('DIR_APPLICATION', 'home3/crumpy360/public_html/store/upload/catalog/');


and does work for everything (that i can see) with the exception of this issue.

Do you have any idea why this could not be working? I am sure this is the correct directory and it works perfectly with SEO URL's off.

Any help would be helpful as i am literally out of ideas :(

Thank you!!!!!

Newbie

Posts

Joined
Sun Aug 21, 2016 6:33 pm

Post by fido-x » Sat Oct 15, 2016 6:26 pm

Your RewriteBase should be stated as:

Code: Select all

RewriteBase /store/upload/

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Crumpy1 » Sat Oct 15, 2016 7:21 pm

Thank you for helping. I have tried this but i still get the 404 error. Could something else be causing a conflict?

Newbie

Posts

Joined
Sun Aug 21, 2016 6:33 pm

Post by fido-x » Sat Oct 15, 2016 7:31 pm

Okay, try setting your RewriteBase to:

Code: Select all

RewriteBase /~crumpy360/store/upload/

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Crumpy1 » Sat Oct 15, 2016 7:35 pm

Yet again, you have saved my hide. It works perfectly. Thank you!!!

Newbie

Posts

Joined
Sun Aug 21, 2016 6:33 pm

Post by fido-x » Sat Oct 15, 2016 7:55 pm

No worries.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia
Who is online

Users browsing this forum: No registered users and 36 guests