I want to setup simpler urls in nginx to login into wordpress i.e. /admin /login in nginx

I have tried multiple ways of tackling this with no luck. any ideas?

currently working with this, but I know it's not working

if ($uri ~* "/login") { rewrite ^(.*)$ http://$host/wp-admin/; }

Final Working Version: if ($uri ~* "/login") { rewrite ^/login(/.*)? /wp-admin$1; }

link|improve this question

Please show us all the ways which you had tried? – quanta Sep 22 '11 at 13:16
good point, I just posted what I am working with – chris hough Sep 22 '11 at 13:19
What did you get when you access http://$host/login in browser? Did you take a look at error log? – quanta Sep 22 '11 at 13:30
feedback

1 Answer

up vote 0 down vote accepted

Rewriting works largely the same as in Apache, but with different syntax:

http://wiki.nginx.org/HttpRewriteModule

Something like this should do the trick:

rewrite ^/admin(/.*)? /wp-admin$1
link|improve this answer
thank you so much for your help, I was able to use your segment to add the "login" I wanted. # short cuts if ($uri ~* "/login") { rewrite ^/login(/.*)? /wp-admin$1; } – chris hough Sep 28 '11 at 1:02
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.