Post by Havouzatrack » Mon Dec 16, 2024 1:48 am

I have a new OC 3.0.4 installed on Ubuntu 24.04 using Nginx. Shop works but I cant get friendly urls because I cant use .htaccess in Nginx. Is there someone who has changed the block file to added what is necessary to use friendly url with Nginx

Regards

Anders

New member

Posts

Joined
Mon May 25, 2020 7:17 pm

Post by svtodsvtod » Mon Dec 16, 2024 2:01 am

Hello for everybody! When i receive message on the email, I can't answer! How i can find the email to sender to can answer to him?
Thank you in advance
Best regards

Newbie

Posts

Joined
Mon Dec 21, 2020 11:59 pm

Post by by mona » Mon Dec 16, 2024 2:14 am

danger wrote:
Fri May 06, 2016 7:17 am
This worked :D

Code: Select all

# SEO URL Settings
  # Nginx configuration of OC htaccess
  location = /sitemap.xml {
    rewrite ^(.*)$ /index.php?route=feed/google_sitemap break; 
  } 

  location = /googlebase.xml {
    rewrite ^(.*)$ /index.php?route=feed/google_base break; 
  } 

  location / {
    # This try_files directive is used to enable SEO-friendly URLs for OpenCart
    try_files $uri $uri/ @opencart;
  }

  location @opencart {
    rewrite ^/(.+)$ /index.php?_route_=$1 last;
  }
  # End SEO settings
It didn't at first because I had a duplicate location / { from before.
sudo nginx -t is helpful ;)

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by svtodsvtod » Wed Dec 18, 2024 5:54 pm

Thank you, but when i put the code contact page lost

Newbie

Posts

Joined
Mon Dec 21, 2020 11:59 pm

Post by nonnedelectari » Wed Dec 18, 2024 7:02 pm

svtodsvtod wrote:
Wed Dec 18, 2024 5:54 pm
Thank you, but when i put the code contact page lost
my guess is that

Code: Select all

rewrite ^/(.+)$ /index.php?_route_=$1 last;
should be

Code: Select all

rewrite ^/(.+)$ /index.php?_route_=$uri last;

Active Member

Posts

Joined
Thu Mar 04, 2021 6:34 pm

Post by svtodsvtod » Fri Dec 20, 2024 4:58 pm

It still 404 error in some pages! In which file i need put the code rewrite ^/(.+)$ /index.php?_route_=$uri last;
Thank you in advance! Best regards!

Newbie

Posts

Joined
Mon Dec 21, 2020 11:59 pm

Post by nonnedelectari » Fri Dec 20, 2024 11:45 pm

svtodsvtod wrote:
Fri Dec 20, 2024 4:58 pm
It still 404 error in some pages! In which file i need put the code rewrite ^/(.+)$ /index.php?_route_=$uri last;
Thank you in advance! Best regards!
I am confused by your confusion.

You have been given nginx directions which you say do not solve all issues.
I gave a correction suggestion to those directions which you say also does not solve the issue for "some pages" which is also not helpful.
Then you ask where to put those directions which kind of puts me in the twilight zone.

So, I am confused.

Active Member

Posts

Joined
Thu Mar 04, 2021 6:34 pm

Post by khnaz35 » Sat Dec 21, 2024 12:23 am

nonnedelectari wrote:
Fri Dec 20, 2024 11:45 pm
I am confused by your confusion.
Don't be confused , the issue here is that their are 2 OPs and one has problem with the Nginx and the other once has issue with the email.
So the person who is replying is for email and i would suggest
svtodsvtod
to open a new topic or search the forum first before opening a new topic

Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia
Who is online

Users browsing this forum: No registered users and 6 guests