1

Due to duplicate content issue, I want to redirect all pages of /articles/* to newly created sub directory /article/*.

How do I redirect all pages of /articles to /article using .htaccess file?

1 Answer 1

1

Not sure how this would resolve "duplicate content issues", but anyway...

Redirect 302 /articles/ /article/

The mod_alias Redirect directive is prefix-matching, so the above matches /articles/<anything> and redirects to /article/<anything> - passing on the <anything> part.

This is naturally a 302 (temporary) redirect.

However, if you have other (particularly mod_rewrite) directives in your .htaccess then you may need to change this. The order is also important.

Reference:

2
  • Thanks MrWhite, but the above answer isnt working. :(
    – Vijay Labh
    Commented Jun 15, 2019 at 11:49
  • 1
    Edit your question to show your .htaccess file. Commented Jun 15, 2019 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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