Joomla SEF with nginx

Discussion in 'General' started by maxxer, Apr 8, 2020.

  1. maxxer

    maxxer Member

    Hi.
    I've nginx ISPConfig. For a single host I have different joomla installations for which I'd like to enable SEF. SEF is enabled by default on latest versions, but it won't work with ISPConfig out of the box. The urls enabled are like

    web.sit.e/index.php/slug1
    So that should work without special rules. Unfortunately it seems nginx is not trying index.php and returns 404. I cannot figure out why, anyone has ideas?
    thanks
     
  2. maxxer

    maxxer Member

    Solved with this

    Code:
    # for joomla installations in subdir
    location ~ ^/(?<anyfolder>[a-z\-]+\/) {
       try_files $uri $uri/ /${anyfolder}index.php?$args;
    }
    
    # if the above doesn't match (missing traling /) handling for joomla site in root
    location / {
       try_files $uri $uri/ /index.php?$args;
    }
     

Share This Page