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?
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: