Jonathan John
Jonathan John

Reputation: 195

How to 301 redirect for tags and categories in wordpress?

Hi Please sorry if my question was simple or very basic. But please some one tell me how to fix this problem i need to redirect all my website pages and post from old url to new one

example :

blog.mysite.com/posttitle.html 

301 redirect to

mysite.com/blog/posttitle.html 

Already some rule written in htaccess but it only redirects blog posts and pages. 301 redirection is made only for the blog post and pages. But not for all tags, all Categories and all author pages. the following pages are not redirecting ,

blog.mysite.com/tag/mytagname 
blog.mysite.com/categories/categoriesname 
blog.mysite.com/author/authorname 

how to redirect this to new site

mysite.com/blog/tag/mytagname 
mysite.com/blog/categories/categoriesname 
mysite.com/blog/author/authorname 

Upvotes: 2

Views: 3223

Answers (1)

James Jones
James Jones

Reputation: 3899

There are plugins that can take care of all this for you. No messing with .htaccess. All done by modifying WordPress own rewrite rules

If you want to do yourself try adding this to your .htaccess

RewriteEngine on 
RewriteRule ^(.*)$ http://your-site.com/blog/$1 [R=301,

This would go before the WordPress specific part of .htaccess 'begin WordPress'. That section can be overwritten by WordPress automatically.

Upvotes: 1

Related Questions