Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-03-28, 19:35:13

Author Topic: Kloxo MR - Nginx Rewrite Rules for Opencart  (Read 7326 times)

0 Members and 1 Guest are viewing this topic.

Offline djscooby

  • Valuable Member
  • *
  • Posts: 119
  • Karma: +0/-0
    • View Profile
Kloxo MR - Nginx Rewrite Rules for Opencart
« on: 2013-06-01, 03:54:30 »
Hi guys

After some searching i finaly find some rules for nginx and opencart.
These rules support SEO urls also..

So if anyone needs to setup opencart e-commerce with nginx on kloxo here's the rules that needs to apply :

1. Inside /home/nginx/conf/globals create file opencart.conf with contents :
Code: [Select]
location ~/admin {
       index index.php;
    }
location ~/image/data {
        autoindex on;
   }
location ~/ {
       try_files $uri @opencart;      
    }
location @opencart {
        rewrite ^/(.+)$ /index.php?_route_=$1 last;
    }

2. Inside /home/nginx/conf/domains find the .conf file of your domain and edit it
in line 33+77 (*before the closing })  add :
Code: [Select]
include '/home/nginx/conf/globals/opencart.conf';

3. Save the file and then from SSH run
Code: [Select]
service nginx restart
4. Remeber that if you change webservers or run "fixweb" then u need to reapply step 2.


PS: It is possible to apply this as a template inside .tpl nginx files, but i can't remember how to. If anyone knows please share.
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Kloxo MR - Nginx Rewrite Rules for Opencart
« Reply #1 on: 2013-06-01, 04:21:57 »
Don't use domains.conf.tpl but copy domains.conf.tpl to custom.domains.conf.tpl and then modified custom.domains.conf.tpl and then run 'sh /script/fixweb; sh /script/restart-all'.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

 


Top 10 Social Networking:    Facebook    Twitter    LinkedIn    Pinterest    Google Plus    Tumblr    Instagram    VK    Flickr    Vine
Click Here

Page created in 0.066 seconds with 21 queries.

web stats analysis