htaccess : how to redirect subfolder to the root subdomain?

Discussion in 'Apache' started by Cameljourney, Jul 11, 2012.

  1. #1
    So, I have the following URLs structure:

    http://demo.mysite.com/subfolder1/
    http://demo.mysite.com/subfolder2/
    http://demo.mysite.com/subfolder3/
    http://demo.mysite.com/subfolder3/file.ext
    and so on............
    Code (markup):
    I want to redirect all traffic from the subfolders along with all files inside it to the root subdomain :

    http://demo.mysite.com/subfolder1/   ->    http://demo.mysite.com/
    http://demo.mysite.com/subfolder2/   ->    http://demo.mysite.com/
    http://demo.mysite.com/subfolder3/   ->    http://demo.mysite.com/
    http://demo.mysite.com/subfolder3/file.ext   ->    http://demo.mysite.com/
    Code (markup):
    What htaccess code should i put on my demo.mysite.com directory ??


    .
     
    Cameljourney, Jul 11, 2012 IP