.htaccess - Redirect all wordpress posts to a sub-directory -


i'm moving wordpress blog root http://website.com/blog. consequently need redirect links such http://www.website.com/2015/05/post-title http://www.website.com/blog/2015/05/post-title, http://www.website.com/2014/03/post-title http://www.website.com/blog/2014/03/post-title, etc. couldn't find how correctly .htaccess.

try adding top of htaccess file in document root:

rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !^/blog rewriterule ^([0-9]{4}/[0-9]{2}/.*)$ /blog/$1 [l,r] 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

html - How can i make an element from a bottom stacking context stays in front of another higher stacking context? -

html - href attribute breaking an element -