Jump to content

Friendly urls & URL rewrites in NGINX?


Recommended Posts

Can someone tell me, or point me towards documentation that tells me how friendly URLs are put together?

I'm trying to convert a site that has had friendly URLs switched on for a long time, but I'm trying to enable URL rewrites to kind of finish the job.

My current config for NGINX looks like this:

location / {
    index     index.php index.html index.htm;
    try_files $uri $uri/ /index.php?$uri&$args;
    root      /var/www/ips/;
}

I thought that might do it, and it works for bits, but not everything.

For example the URL

http://example.com/forums/ gets translated correctly to http://example.com/index.php?/forums/ which works, but a topic URLlike https://example.com/forums/topic/12345-this-is-a-topic/ ends up with a too many redirects error.

I suspect I should be using the rewrite directive rather than try files, but I've not figured out the right config yet ... has anyone else configured this already?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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