Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use this redirect rule to redirect users from www.domain.com/admin to www.domain.com/wp-admin on a WordPress site.

RedirectMatch 301 \@admin http://www.domain.com/wp-admin

The problem is that instead redirecting to wp-admin/, it redirects to an article called Administrators are awesome people (slug : administrators-are-awesome-people)

I can guess what is going on, WP sees that there is an article slug starting with "admin", and redirects to it, overruling my own rule.

Is there a way to be more specific, like saying "redirect urls that end with exactly admin ?

share|improve this question

migrated from stackoverflow.com May 22 '11 at 21:52

This question came from our site for professional and enthusiast programmers.

1  
You might want to take a look at the "Redirection" wordpress plugin - Certainly saves time. – Johannes Pille May 22 '11 at 13:34

Try this

 RewriteRule ^admin?$ "http\:\/\/www\.domain\.com\/wp-admin\/" [R=301,L]
share|improve this answer

Your Answer

 
discard

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