The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

redirect a subfolder to subdomain

Discussion in 'General Discussion' started by ghena_f, Jul 26, 2012.

  1. ghena_f

    ghena_f Registered

    Joined:
    Jul 26, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    hello
    I have created a subdomain in cpanel : subdomain.site.com
    and the subdomain is redirecting to subfolder : site.com/subfolder
    but I would like to disable the view of the subfolder in url
    for instance when the user types : site.com/subfolder
    it redirect him back to : subdomain.site.com

    I tried to create a redirection from site.com/subfolder to subdomain.site.com in cPanel
    but it give me error

    Code:
    There was an error adding the redirect.
    
    Redirecting subfolder to http://subdomain.site.com will cause a redirection loop because http://site.com/subfolder, which is located at /home/user/public_html/subfolder, is above http://subdomain.site.com, which is located at /home/user/public_html/subfolder.
    is there something I should write in the subfolder .htaccess to make this work?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you check the existing .htaccess file in the account's public_html directory? Look for any redirect or mod_rewrite rules that could be causing this behavior. You can try temporarily disabling any existing redirect rules to rule them out as the cause of the problem.

    Thank you.
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Redirecting a location to itself is a redirection loop. You cannot redirect the subfolder to the subdomain, because they both exist at the same path.
     
Loading...

Share This Page