1a-Websolutions

Active Member
Aug 24, 2006
42
0
156
Hey all,

I have the same issue - Subdomains redirection dont work - i recieve a 404:

Forbidden
You don't have permission to access / on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

How cann I fix this?

Regards

WHM 10.8.0 cPanel 10.9.0-R37
Fedora i686 - WHM X v3.1.0
 

levelsupport

Well-Known Member
Oct 7, 2006
47
0
156
can you paste me the contents of the .htaccess file you have on the directory you are redirecting.
 

1a-Websolutions

Active Member
Aug 24, 2006
42
0
156
Hey,

you cann fix it easy:

OLD:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mail_1a-websolutions.ch$ [OR]
RewriteCond %{HTTP_HOST} ^www.mail_1a-websolutions.ch$
RewriteRule ^(.*)$ https://1a-websolutions.ch:2096/horde/login.php [R=301,L]

NEW

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mail.1a-websolutions.ch$ [OR]
RewriteCond %{HTTP_HOST} ^www.mail.1a-websolutions.ch$
RewriteRule ^(.*)$ https://1a-websolutions.ch:2096/horde/login.php [R=301,L]

Change the Underline-Charakter to a Dot-Charakter bevor the Domainname....;) -

Mayby a BUG by Cpanel???

Regards
 
Last edited:

alwaysweb

Well-Known Member
Mar 8, 2002
97
0
306
Dallas, TX
cPanel Access Level
Root Administrator
That works for one subdomain, but you have to do it manually for each. I have some customers trying to set up dozens of subdomain redirects, and trying to explain to them how to fix this is not easy!

Although not the best workaround, I was able to edit the file:

/usr/local/cpanel/base/frontend/x/subdomain/doredirectdomain.html

and change the hidden form field (around line #20) from:

<input type=hidden name=domain value="<cpanel print="$FORM{'domain'}">">
to:

<input type=hidden name=domain value="<cpanel sprint="$FORM{'domain'},_,0">.<cpanel sprint="$FORM{'domain'},_,1">">
and it works properly.



Cpanel should fix this bug by editing the listsubdomainsop() function call :

<cpanel SubDomain="listsubdomainsop()">

called from:

/usr/local/cpanel/base/frontend/x/subdomain/index.html

to send the user to doredirectdomain.html?domain=sub.domain.com

instead of:

doredirectdomain.html?domain=sub_domain.com

as it does now! (note the "_" instead of a ".")
 

cytexone

Member
Mar 13, 2004
10
0
151
Awesome man, this fix worked. The only thing that doesn't work is when you edit an existing redirect it doesn't show what it's being redirected to...

Is that the case?
 

carverrn

Member
Jan 7, 2003
17
0
151
Is this still a bug because we're using cPanel Version 11.6.0-RELEASE, cPanel Build 15076 and using Redirects from cPanel doesn't work for subdomains?

I tried searching the cPanel bugs list and couldn't even find a report that sounded like this problem. Do they even know about the problem?

My hosting companies tech support don't seem to understand what the problem is so I'm trying to figure it out so that I can explain it to them.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Is this still a bug because we're using cPanel Version 11.6.0-RELEASE, cPanel Build 15076 and using Redirects from cPanel doesn't work for subdomains?

I tried searching the cPanel bugs list and couldn't even find a report that sounded like this problem. Do they even know about the problem?

My hosting companies tech support don't seem to understand what the problem is so I'm trying to figure it out so that I can explain it to them.
You're a little out of date there for RELEASE. Just so you know, http://changelog.cpanel.net/ details all the fixes in newly published builds.

RELEASE Build 16789 fixed some more redirect issues.
 

carverrn

Member
Jan 7, 2003
17
0
151
Thank you DavidG.

I will see if I can get my hosting company to update.

In the mean time I think I found the problem. cPanel adds a RewriteRule of:

RewriteRule ^pattern/?$ redirect_url [R=302,L]

I think it should be something like:

RewriteRule ^.*/pattern/?$ redirect_url [R=302,L]

At least the redirect works correctly when I manually make this change to my .htaccess file.

I will check updates to see if that problem was addressed.

Regards,
Rich
 

carverrn

Member
Jan 7, 2003
17
0
151
I've looked through the Change Logs and searched the bug reports and I don't see a bug fix or report that matches this problem.

My problem turns out not to be the "_" issue mentioned in this thread which was Bug # 4677.

Regards,
Rich
 

carverrn

Member
Jan 7, 2003
17
0
151
I originally thought that the actual rule should be something like:

RewriteRule ^.*/pattern/?$ redirect_url [R=302,L]

But that messed up the cPanel Redirects listing of existing redirects.

What does work correctly is:

RewriteRule ^subdomain/pattern/?$ redirect_url [R=302,L]