Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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!




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: