Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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 at 13:54

1 Answer 1

Use this:

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

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.