php - .htaccess redirect from subfolder to root keeping paths -


i'm migrating site need redirect content www.oldurl.com/subfolder www.newurl.com , keep links, example:

www.oldurl.com/subfolder/subfolder2 

needs redirect

www.newurl.com/subfolder2 

and

www.oldurl.com/subfolder/subfolder3/link.html 

needs redirect

www.newurl.com/subfolder3/link.html 

my .htacess looks this:

rewriteengine on rewriterule ^subfolder/(.*)$ /$1 [r=301,l] 

it redirecting www.oldurl.com/subfolder www.newurl.com/ not follow old paths sends request home page

for new conditions new .htaccess

rewriteengine on rewriterule ^subfolder/(.*)$ http://www.newurl.com/$1 [r=301,l]  

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -