Jump to content

Friendly url on Nginx


MarketingFans

Recommended Posts

Posted

Hi,

I've moved my community (+ Wordpress) to another host. I went from Apache to Nginx.
Everything looks to be working except for the 'friendly url'.

I know Nginx doesn't support htaccess but i don't know the solution.
If i disable the friendly url setting the community works fine...but all my links are broken.

Please advise.

Thanks,
Ronald

Posted

Add this to the Nginx configuration. You may need to contact your host to do it.

location / {
  try_files $uri $uri/ /index.php?$args;
}

If your IPS suite is not in the document root then modify the paths accordingly:

location /path-to-ips {
  try_files $uri $uri/ /path-to-ips/index.php?$args;
}

 

Posted

Just a followup.... if you want to use the REST API, that will likely need its own "try" parameter block.

Here's the two lines I use in my nginx config file (I'm using Openmediavault and its nginx plugin)

location / {
    index index.html index.php;
    try_files $uri $uri/ /index.php?$args;
}
location /api/ {
    index index.html index.php;
    try_files $uri $uri/ /api/index.php?$args;
}

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...