Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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; }

share|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 –  chrishough 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

1 Answer 1

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
share|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; } –  chrishough Sep 28 '11 at 1:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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