Fork me on GitHub
Please upgrade to 2.1.x here. The 2.0 branch is no longer being updated.
Critical: Update to 2.1.8, released 15 Jan.

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.