![]() |
|
Sentora Panel redirecting to a hosted website - Printable Version +- Sentora Support Forums (https://senforums.mach-hosting.com) +-- Forum: Sentora Forum Archives (https://senforums.mach-hosting.com/forumdisplay.php?fid=5) +--- Forum: Sentora Public Support Forums v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=32) +---- Forum: General Support Forum v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=36) +---- Thread: Sentora Panel redirecting to a hosted website (/showthread.php?tid=2721) Pages:
1
2
|
Sentora Panel redirecting to a hosted website - HmumB - 03-26-2016 Hello. I recently installed Sentora v1.0.3 on my sub domain say :- panel01.myhost.com As I installed a SSL certificate for my Sentora Panel it works great over here https://panel01.myhost.com But when I type the Non https link say panel01.myhost.com it redirects me to a website hosted inside in my Sentora panel. [It Opens the website that I have added first to my Sentora Panel] I tried to add the below rule to .htaccess file located here /etc/sentora/panel/ which didnt help as well. Code: #Enforce
SSL
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]a2enmod rewrite is Enabled and I did restart apache2 service after applying changes. It would be great if some help me to automatically redirect the panel01.myhost.com to https://panel01.myhost.com Thank You & Regards. RE: Sentora Panel redirecting to a hosted website - TGates - 03-26-2016 Looks like you didn't 'turn on' the rewrite engine also make sure it is first entry in .htaccess. Code: # Force SSL - Always first!
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]RE: Sentora Panel redirecting to a hosted website - HmumB - 03-26-2016 @TGates, Thank You for your reply. But it still doesn't redirect to https link. Please have a look at my .htaccess file here :- http://s23.postimg.org/b5fi086e3/Sentora_htaccess_file.png I did try to copy paste the code as you posted including the - Always first! in first line, but no luck. The Non-https link takes me to a website hosted inside the Sentora Panel. Thank You & Regards. RE: Sentora Panel redirecting to a hosted website - HmumB - 06-29-2016 Any Help, I still did not figure this out. rest all things are going all good. RE: Sentora Panel redirecting to a hosted website - TGates - 06-29-2016 Hmm. Here is my complete .htaccess: )in the panel/ folder): Code: RewriteEngine on
# Force SSL - Always first!
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://cp.domain.com/$1 [R,L]
# Standard Sentora Rewrite Ruleset
RewriteRule ^api/([^/\.]+)/?$ bin/api.php?m=$1 [L]
RewriteRule ^apps/([^/\.]+)/?$ etc/apps/$1 [L]
# Optionally you can uncomment the below line and configure your domain to only allow access from the FQDN.
#RewriteCond %{SERVER_NAME} !^cp\.domain\.com$
#RewriteRule ^ - [F]
# Deny access to some file types/directories
RewriteRule ^/?(\.git|\.tx|SQL|config|logs|temp|tests|program\/(include|lib|localization|steps)) - [F]
RewriteRule ^(etc/tmp|etc/zppy-cache|/etc/lib/pChart2/cache|etc/build) - [F,L,NC]
# Disable index listing
Options -IndexesRE: Sentora Panel redirecting to a hosted website - HmumB - 06-29-2016 I modified the code in my .htaccess file same as yours, but No luck. Let me explain you in more detail. I face 2 issues right now. Case 1: I have installed LetsEncrypt SSL for the control panel (https://panel.domain.com). When I visit the control panel page via https it works perfect. But when I visit the the page via only http it says This site can’t be reached. What I want is that http should automatically get redirect to https Case2: After setting up my Sentora installation when I add my 1st domain say mydomain.com everything works good, but again when I visit my Sentora panel via http (http://panel.domain.com), it opens up my 1st added domain i.e mydomain.com which is very weird. Thanks & Regards. Really appreciate it. RE: Sentora Panel redirecting to a hosted website - TGates - 06-30-2016 Ok, let me check my configs for Lets Encrypt and see how I configured it. I'll get back to you. OK... Did you use the internal custom vhosts entry or the external manual config file setup? (I MIGHT reconfigure Cer_Manager to use Let's Encrypt certificates depending on my free time.) RE: Sentora Panel redirecting to a hosted website - HmumB - 06-30-2016 What exactly I have done. 1. Global Sentora Entry: Added it from Home > Server Admin > Module Admin > Apache Config. Code: SSLEngine on
SSLProtocol ALL -SSLv2 -SSLv3
SSLHonorCipherOrder On
SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
SSLCertificateFile /etc/letsencrypt/live/panel.domain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/panel.domain.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/panel.domain.com/chain.pem2. I have changed Sentora Apache Port from 80 to 443 from here:- Home > Server Admin > Sentora Config Thank You. RE: Sentora Panel redirecting to a hosted website - TGates - 06-30-2016 You also need to forward http (80) traffic to https (443). If there is no vhost for port 80 for your panel, you will get the problem you have ![]() Basically you need an http and https virtualhost entry for your panel. Right now, your server does not know what to do with requests to your panel url when called with http. Checking on how to do it using the custom vhost entry. RE: Sentora Panel redirecting to a hosted website - Ludaking - 06-30-2016 UPDATE : to redirect http to https go at /etc/sentora/panel open .htaccess and write this Code: RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]![]() isn't needed to write 2 times rewriteengine on. -- |