Nginx /wp-admin/ Rewrites


#1

Hi,

I recently moved all my data from a VPS to a new Dedicated box running Nginx. I have followed DH’s nginx wiki http://wiki.dreamhost.com/Nginx in an attempt to set up some url rewrites. I am running wordpress and what I want to do is, set up a rewrite to change www.mydomain.com/wp-admin/ to www.mydomain.com/login/. In my attempt so far I have setup a wordpress.conf file located: /home/myuser/nginx/mydomain.com/wordpress.conf in this I have the following rewrites:

location ~* /login/ {
rewrite ^/login/(.)? /wp-login/$1;
}
rewrite ^/login/(.
).php$ /wp-admin/$1.php last;
rewrite ^/login/$ /wp-admin/index.php last;

I then restarted my box to ensure that nginx updated but when the site came back online, the rewrites didn’t seem to take effect.

Do you guys have any idea why these are not working?

Thanks.


#2

However, if that doesn’t help, there are alternative ways to do this here without involving nginx configs: