I need to permanently redirect part of a website to a different domain and URL structure.
Everything that matches: example.com/year/month/day/page-name/ and www.example.com/year/month/day/page-name/
Needs to redirect to: www.sample.com/sub/sub2/year/month/page-name/
For example: example.com/2013/11/09/a-great-page/
should permanently point to: www.sample.com/sub/sub2/2013/11/a-great-page/
But I don't want to redirect any other pages on the site: example.com/a-random-page Shouldn't redirect anywhere.
My htaccess chops and regex skills are a little rusty, so any help would be greatly appreciated!
Enable
mod_rewrite
and.htaccess
throughhttpd.conf
(if not already enabled) and then put this code in yourDOCUMENT_ROOT/.htaccess
file: