ghena_f

Registered
Jul 26, 2012
1
0
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,903
2,237
463
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.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
41
348
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.