I have made a change to my site so that it is no longer in a subdirectory of my root domain. (it is now in the root of the domain).
I have made the move successfully but I would like to put a 301 redirect into my htaccess so that people visiting the old links make it to the new site.
A sample link on my site has gone from www.mysite.com/olddirectory/samplelink to www.mysite.com/samplelink
So basically, I am looking for something that would say if any one goes to www.mysite.com/olddirectory/*wildcard_here* they would be redirected to www.mysite.com/*wildcard_here* .
On another site, I was doing something similar but in the other direction. I had moved a site into a directory from the root, so I had
Is there any way to do what I am trying to do? It is important that if some one goes to a directory that is not "olddirectory", they should not be redirected.Code:RewriteEngine on RewriteCond $1 !^newdirectory RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]
Thank you in advance