Jump to content

Friendly url on Nginx


MarketingFans

Recommended Posts

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

Link to comment
Share on other sites

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;
}

 

Link to comment
Share on other sites

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;
}

Link to comment
Share on other sites

Archived

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

  • Recently Browsing   0 members

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