Hello everybody. I have a particular situation that has been kicking me in the pants for a couple of weeks and hope someone can help me out here.
I have a site that had old dynamic urls. I switch to sef urls, and didnt have the time to 301 redirect the old urls to new sef urls. There were also roughly 700 articles or news items and pages and I didnt want to write than many individual rules.
With that being said, I now have over 600 404 page not found errors. Many of them come from directories, and if I can apply a mod rewrite to a handful of folders, it would take care of 90% of my 404 page not found problem.
The problem Im facing right now is that the old trailing url is being applied to new working live folder or directory. I need the rewrite to not append the old trailing url, just redirect to a new directory like in the following example.
RewriteRule ^/forum/(.*) http://www.mydomain.com/articles/ [L,R=301]
RewriteRule ^/content/.+ http://www.mydomain.com/articles/ [L,R=301]
RewriteRule ^/component/.+ http://www.mydomain.com/articles/ [L,R=301]
RewriteRule ^/gallery/.+ http://www.mydomain.com/photography/ [L,R=301]
RewriteRule ^/gallery2/.+ http://www.mydomain.com/photography/ [L,R=301]
RewriteRule ^/articles/category/(.*) http://www.mydomain.com/articles/ [L,R=301]
RewriteRule ^/articles/1/(.*) http://www.mydomain.com/articles/ [L,R=301]
As you can see, Ive tried /.+ and /(.*) and i still tries to append to the new url.
for example:
/forum/1/2/24 should redirect to http://www.mydomain.com/articles
NOT http://www.mydomain.com/articles/1/2/24
I dont have an articles/1/2/24
I would just like it to redirect all old urls from /forum to the new live folder at http://www.mydomain.com/articles/
I know this must be possible but have no idea how to do this. Any help would be greatly appreciated. or, if theres a better way than having to hand write over 700 301 redirects which I dont have time nor desire to do. Thank you in advance for any assistance with this.