Howdy, Stranger!

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

Try Vanilla Forums Cloud product

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Vanilla is proud to present version 2.2.
Please upgrade to 2.1.x here. The 2.0 branch is no longer being updated.

Pretty URLs or how do I get rid of: 'index.php?p=/' on nginx?

edited March 2013 in Vanilla 2.0 Help

After a fresh move to a local vanilla installation, my routes are all ugly:

forum/index.php?p=/discussions/etc...etc...

How can I change these to pretty urls? Like:

forum/discussions/etc.. etc...

How do I make 'index.php?p=/' disappear?

Best Answer

  • edited December 2011 Answer ✓

    OK boys:

    The fix to my problem turned out to be relatively simple.

    Addition to nginx config file:


    location /forum {try_files $uri $uri/ @forum;}


    location @forum {rewrite ^/forum(.+)$ /forum/index.php?p=$1 last;}

    Restart nginx.

    Change false to true in the Vanilla conf file:


    $Configuration['Garden']['RewriteUrls'] = TRUE;

Answers

Sign In or Register to comment.