Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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 have a lot of 404 pages looks like that:

  • lalala/lalala/Users_PasswordReminder.aspx?something=lala
  • lilili/lilili/Users_PasswordReminder.aspx
  • /Users_PasswordReminder.aspx?username=admin
  • etc.

I want all of the URLs who have Users_PasswordReminder.aspx redirect to my main page of my domain.

how can I do that with .htaccess?

share|improve this question
You might have a path relative link somewhere in your pages, which causes these links to be seen. You should check your code for <a href="Users_PasswordReminder.aspx"> code and replace it with correct path absolute URL, for example <a href="/Users_PasswordReminder.aspx"> – Tero Kilkanen Mar 19 '14 at 13:54

Use this:

RedirectMatch 301 Users_PasswordReminder\.aspx http://example.com
share|improve this answer

Your Answer


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.