borissvetnikov

Registered
May 24, 2004
1
0
151
Is it leagal to redirect site.com to site.com/subdir?

Using Cpanel redirects created an infinite loop. Redirection to a subdomain subdir.site.com created an infinite loop as well.

The redirection worked well via addon domains but I no longer possess one.

Is there a way to setup this redirection via Cpanel? I read somewere that html and .htaccess redirects are not good for the search enginees or this is not true?
 

jols

Well-Known Member
Mar 13, 2004
1,107
3
168
I would like to know this as well.

I believe we used to be able to using the Redirects tool in cPanel to redirect any and all traffic to a particular subdirectory, but now I only get the Infinant loop error.

I KNOW I can set this up manually via .htaccess, but I need to be able to tell our hosted customers how they can use their cPanel to do this.

Still possible?
 

jols

Well-Known Member
Mar 13, 2004
1,107
3
168
Okay, here's the issue, I think:

We used to be able to use the cPanel Redirects utility to insert just a subdirectory name in the redirect-to field. But now we are forced to insert a whole URL instead. As such, when you insert a URL of this same web site, even though it includes a subdirectory, the apache system will see the domain and evoke the redirect again, thus the infinate loop.

Is there any way we can just use a cPanel tool to direct ALL traffic to a subdirectory?
 

jols

Well-Known Member
Mar 13, 2004
1,107
3
168
Yup, thanks. I am aware of plenty of html tricks to do this, but some of our customers really want those permanent 301 redirects that they used to be able to do straight out of cPanel, using the Redirects tool there.

I am wondering why cpanel.net took this functionality away, and what we could do to bring it back?
 

Infopro

Well-Known Member
May 20, 2003
17,076
523
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
I would like to know this as well.

I believe we used to be able to using the Redirects tool in cPanel to redirect any and all traffic to a particular subdirectory, but now I only get the Infinant loop error.

I KNOW I can set this up manually via .htaccess, but I need to be able to tell our hosted customers how they can use their cPanel to do this.

Still possible?

Can you post your .httaccess here after setting up a redirect in cPanel you think should work, but does not?
 

jols

Well-Known Member
Mar 13, 2004
1,107
3
168
Thanks for your help.

Here's what I had to set up manually to get this to work (in .htaccess):

--------
RewriteEngine on

RewriteCond %{HTTP_HOST} index.html
RewriteRule ^.*$ "http\:\/\/www\.TrueChange\.net\/main\/" [R=301,L]
--------

Now the goal here is to direct all traffic using:
http://www.truechange.net/

... to

http://www.truechange.net/main/

However, cPanel now forces one to use a full URL as the target. So when I go to cPanel for this account, and click Redirects, I just put this in the "Redirects to" field:

http://www.truechange.net/main/

... leaving everything else at default, then I click Add.

The response message on the next page includes this:

** All Public Domains **/ redirects to→ http://www.truechange.net/main/

But when I got to http://www.truechange.net/ I get this in my browser:
--------------------
Redirect Loop

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
The browser has stopped trying to retrieve the requested item. The site is redirecting the request in a way that will never complete.
--------------------

... and here is the requested scripting that cPanel inserts in the .htaccess file:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^.*$ "http\:\/\/www\.truechange\.net\/main\/" [R=301,L]



Is there a solution for this?
 

xisn

Well-Known Member
Dec 4, 2004
136
5
168
cPanel Access Level
Root Administrator
I know this is a little old but I am also seeing issues with this... In your htaccess file change the first part of the last line...

This is your current:

Code:
RewriteRule ^.*$ "http\:\/\/www\.TrueChange\.net\/main\/" [R=301,L]

Make it look like this:
Code:
RewriteRule [COLOR="Red"][B]^/?$[/B][/COLOR] "http\:\/\/www\.truechange\.net\/main\/" [R=301,L]
 

Sucesso

Registered
Jul 8, 2007
4
0
51
I know this is a little old but I am also seeing issues with this... In your htaccess file change the first part of the last line...

This is your current:

Code:
RewriteRule ^.*$ "http\:\/\/www\.TrueChange\.net\/main\/" [R=301,L]

Make it look like this:
Code:
RewriteRule [COLOR="Red"][B]^/?$[/B][/COLOR] "http\:\/\/www\.truechange\.net\/main\/" [R=301,L]
Wow, that worked great. I was having the same problem; this fixed it for me.

Is there a way to do this from cPanel?
 

jols

Well-Known Member
Mar 13, 2004
1,107
3
168
Regarding "Is there a way to do this from cPanel? " and YES, this was the original intention of my post. At one time we could indeed do this from cPanel but no more. Apparently cPanel put in a limit, into their Redirect tool that demands use of a full URL, rather than just specifying a sub-directory.

We need a method in cPanel that would enable a user to direct ALL web traffic to a sub-directory. Dear cPanel techs, please re-enable this feature!

Thank you.
 

Sucesso

Registered
Jul 8, 2007
4
0
51
Regarding "Is there a way to do this from cPanel? " and YES, this was the original intention of my post. At one time we could indeed do this from cPanel but no more. Apparently cPanel put in a limit, into their Redirect tool that demands use of a full URL, rather than just specifying a sub-directory.

We need a method in cPanel that would enable a user to direct ALL web traffic to a sub-directory. Dear cPanel techs, please re-enable this feature!

Thank you.
Yes, I would like to be able to do this from cPanel as well.