Hacker News new | comments | show | ask | jobs | submit login

That's actually more complicated than it needs to be, see http://wiki.nginx.org/Pitfalls#Taxing_Rewrites

Bad:

    rewrite ^/(.*)$ http://domain.com/$1 permanent;
Good:

    rewrite ^ http://domain.com$request_uri? permanent;
Better:

    return 301 http://domain.com$request_uri;



Awesome - thanks!




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: