Fork me on GitHub
Current Releases are 2.1 stable (major release) and 2.0.18.11 (security patch for 2.0)
We've also rebooted our GitHub repo, docs, and more!

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

edited March 2013 in Questions

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.