Mod_Rewrite Subdirectory to Root 301 Redirect

Hello--
I would like to redirect all entries formatted like this:

mysite.com/blog/?p=980

to

mysite.com/?p=980

I am moving the CMS to the root of the site instead of a sub folder and I need to redirect all traffic that is still going to the old folder to the PROPER new location (so maintain the query string.... i.e, ?p=2848 but without the folder in there).


Thanks!
nplescherAsked:
Who is Participating?
 
mwiercinConnect With a Mentor Commented:
RewriteRule ^http://mysite.com/blog/(.*)$  http://mysite.com/$1 [R=301,L]

Open in new window

0
All Courses

From novice to tech pro — start learning today.