Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


prestashop in a subdirectory and nginx is a pita
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

prestashop in a subdirectory and nginx is a pita

gappergapper Member
edited March 2021 in General

hello guys, i have wordpress installed on the root / and then prestashop installed on /store/, using nginx here are the relevant parts I added to my nginx's default.conf

for wordpress friendly urls

location / {
    root   /usr/share/nginx/html;
    try_files $uri $uri/ /index.php?$uri$args;
    index  index.php index.html;
}

for prestashop front end

location ~ ^/store/index.php/(.*) {
    if (!-e $request_filename) {
    rewrite ^/.*$ /store/index.php last;
    }
}

for prestashop back end

location ~ ^/store/management/index.php/(.*) {
    if (!-e $request_filename) {
    rewrite ^/.*$ /store/management/index.php last;
    }
}

passing stuff to php-fpm

location ~ \.php$ {
    root           /usr/share/nginx/html;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include        fastcgi_params;
}

however after enabling friendly urls in prestashop, urls of the home page are not loading... the backend works fine... also images not loading on the front end...

every single piece of code I found on the web works when prestashop is installed in the root / otherwise there are no tutorials/guides to get it working on a subfolder lets say /store/

for example prestashop official guide is when you have installed it on root not on a subdirectory: https://devdocs.prestashop.com/1.7/basics/installation/nginx/

Comments

Sign In or Register to comment.