Last post 2 hours 11 min ago
Posts last week 89
Average response time last week 30 min
All time posts 67693
All time tickets 10463
All time avg. posts per day 21

Helpdesk is open from Monday through Friday CET

Please create an (free) account to post any question in the support area.
Please check the development versions area. Look at the changelog, maybe your specific problem has been resolved already!
All tickets are private and they cannot be viewed by anyone. We have made public only a few tickets that we found helpful, after removing private information from them.

#6736 – Cpanel Login Redirect

Posted in ‘SEOInfo and other Weeblr extensions’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Wednesday, 11 May 2016 01:11 UTC
cybersalt
I am wondering if there there is a way (other than creating a redirect for each site using sh404sef) to get sh404sef to ignore calls to domain.com/cpanel.

Typically on a site hosted in WHM/Cpanel, domain.com/cpanel redirects to domain.com:2083, which then gives the option to log in to their cpanel hosting interface.

Right now, sh404sef is handling that url and seeing it at a broken url and shows the 404error page.

As I said, I know how to make a redirect in htaccess to work around this, but was wondering if there is another way.

Tim
 
Wednesday, 11 May 2016 09:02 UTC
wb_weeblr
Hi Tim,

This is not something you can deal with at Joomla or sh404SEF level. The handling of the /cpanel URL must be transferred to Cpanel before being sent to Joomla (which in turn will call upon sh404SEF).

I don't know how your hosting company does the /cpanel URL handling, whether they add something in your .htaccess or directly handle this in the web server configuration, but one way or the other, they have to fix it if it's not working any longer.

Rgds
 
Wednesday, 11 May 2016 10:44 UTC
cybersalt
Thanks for your reply. I am my own hosting company and it doesn't seem possible for .htaccess to redirect to an url that ends in a port number.

I even tried an index.html file (in a folder named cpanel) with a meta-refresh tag redirecting to domain.com:2083 but the folder get's read by Joomla.

Interesting enough, if I put a .html file in the root of the Joomla install that page shows up normally.

it would be nice to have a workaround for this but I guess my clients will just have to remember the port number.

Thanks for your reply.
 
Wednesday, 11 May 2016 10:51 UTC
wb_weeblr
Hi

The .htaccess file from Joomla or any other CMS will redirect anything that doesn't exist to Joomla index.php file.
If you add an xxx.html file somewhere, you will access it because it exists and so the redirect rules (to Joomla root index.php) in the .htaccess will not be triggered.

What you want to do is make an exception to the .htaccess rules, to redirect /cpanel to something:xxx instead of letting the regular redirection to Joomla index.php happen.

it doesn't seem possible for .htaccess to redirect to an url that ends in a port number.
I am not an .htaccess guru, but there is no such restriction. You can redirect to and from URLs with ports. google will find you multiple examples of this.

Rgds
 
Wednesday, 11 May 2016 20:59 UTC
cybersalt
I've look quite a bit in Google on this one and tried many htaccess lines without success. Even creating a folder and file "/cpanel/index.html" and going to domainname.com/cpanel/index.html scoots me right back to a Joomla 404 page, so I think there is something in cpanel itself that is happening.

If I find a solution I'll come back here and post it.
 
Thursday, 12 May 2016 10:26 UTC
wb_weeblr
Hi

I am confused, this should be as simple as:

Redirect 301 /cpanel http://domain.com:2083/

Rgds
 
Thursday, 12 May 2016 10:35 UTC
cybersalt
Welcome to the club. That line is one of the options I tried.

I just added "Redirect 301 /cpanel http://www.basicjoomla.com:2083/" to the htaccess file for www.basicjoomla.com and www.basicjoomla.com/cpanel brings up the 404 page.

I think there is something I am missing in my cpanel set-up that is leading to this peculiar situation - hopefully it's just a setting I have yet to discover.

Tim
 
Thursday, 12 May 2016 10:50 UTC
wb_weeblr
Hi

That line works fine on a test machine, so if you are not redirected to the target site, it means there is something wrong in the htaccess, not in the cpanel setup
I would suggest, to confirm, that you use for instance:

Redirect 301 /cpanel https://www.google.com

I just visited /cpanel on your site, and indeed, no redirect happens. You do get a 404, but most importantly, you stay on the same page.
So despite the fact you have that line in your .htaccess, it's not running. This confirms the problem is not in CPanel, but simply in your .htaccess file.

Maybe try to put this line as the first one in the .htaccess, or remove other parts that seems unnecessary, but may interfere.

Rgds
 
Thursday, 12 May 2016 11:27 UTC
cybersalt
.htaccess if working fine - I have tons of redirects and other rules that are functioning as they should.

I added your google suggestion with no different result.

That gave me the idea to edit the line to redirect "/cpanelnot" to the port.

So I added a second line under the one above - "Redirect 301 /cpanelnot http://www.basicjoomla.com:2083/" www.basicjoomla.com/cpanelnot redirects just as one would expect.

Tim
 
Thursday, 12 May 2016 12:51 UTC
wb_weeblr
Hi

.htaccess if working fine
Sory to be blunt, but if a simple redirect is not happening, there is something broken in the .htaccess you use.

So I added a second line under the one above - "Redirect 301 /cpanelnot http://www.basicjoomla.com:2083/" www.basicjoomla.com/cpanelnot redirects just as one would expect.
So what you are saying is that /cpanel is NOT redirected, but /cpanelNOT actually is redirected?

That would confirm something else, in the .htaccess, is interfering. Don't you have already another redirect/handling for Cpanel in your "tons of redirects and rules"?

Rgds
 
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.