membuat whmcs selalu https://www.


Status
Not open for further replies.

adrian

Apprentice 1.0
apa memang whmcs tidak bisa dibuat selalu https://www. , digeneral setting pada http dan https setting sudah aku setting keduanya dengan mengisi https://www. namun whmcs tetap bisa diakses dengan tanpa www dan juga di home malah tidak ada https nya

di htaccess juga sudah aku buat code tambahan namun malah bentrok dengan redirectnya whmcs

teman disini mungkin bantu saya code htaccessnya atau settingnya agar whmcs selali https://www.
 

Ceboong.Com

Poster 2.0
apa memang whmcs tidak bisa dibuat selalu https://www. , digeneral setting pada http dan https setting sudah aku setting keduanya dengan mengisi https://www. namun whmcs tetap bisa diakses dengan tanpa www dan juga di home malah tidak ada https nya

di htaccess juga sudah aku buat code tambahan namun malah bentrok dengan redirectnya whmcs

teman disini mungkin bantu saya code htaccessnya atau settingnya agar whmcs selali https://www.
Biasa sy pake seperti ini
PHP:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
 

GPLHosting

Hosting Guru
atau bisa juga gini, terserah bisa pilih yg atas (om @semutweb ) atau bawah ini :

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} =domain.com
RewriteRule ^(.*) https://domain.com/ [R]
 

dhyhost

Web Hosting Service
The Warrior
Verified Provider
ini untuk redirect ke www :D

Code:
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

atau

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
 

mustafaramadhan

Hosting Guru
Kalau tambahkan ke index.php bisa:
Code:
<?php

$a = $_SERVER;

$state = 0;

$host = $a["HTTP_HOST"];
$splitter = explode(":", $host);
$domain = $splitter[0];
$port = ($splitter[1]) ? ":{$splitter[1]}" : '';
$requesturi = $a["REQUEST_URI"];
$scheme = $a["HTTP_SCHEME"];

if (strpos($domain, 'www.') === false) {
    $state += 1;
    $domain = "www.{$domain}";
}

if ($scheme === "http") {
    $state += 2;
    $scheme = 'https';
}

if ($state > 0) {
    echo "<script> location.replace('{$scheme}://{$domain}{$port}{$requesturi}'); </script>";
}
 

GPLHosting

Hosting Guru
ooo iya, yg diminta ke "www". kurang teliti.

kalo cuma pengen ke www, pake redirect ya di cpanel nya ya jg ada koq, bisa dipakai :D

ga perlu repot, ngode regex-regex di apache atau .htaccess.
 

Rockman

Hosting Guru
Verified Provider
Ternyata banyak cara untuk redirect ke "www" Monggo dicoba mana yang cocok buat TS
 

naufdotal

Poster 2.0
Jika di nginx, pake config ini mas :D

Code:
 server {
        listen   443 ssl http2; ## listen for ipv4; this line is default and implied
        #listen   [::]:80 default ipv6only=on; ## listen for ipv6

        root /srv/www/clientarea.host.host/public_html;
    index index.php index.html;
    error_log /srv/www/clientarea.host.host/public_html/errorzz.log;

        # Make site accessible from http://localhost/
        server_name clientarea.host.host;

        ssl_certificate /srv/www/clientarea.host.host/ssl/bundle.crt;
        ssl_certificate_key /srv/www/clientarea.host.host/ssl/clientarea.host.host.key;
        ssl_session_cache shared:SSL:20m;
        ssl_session_timeout 60m;
 
        ssl_prefer_server_ciphers on;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
 
        ssl_stapling on;
        ssl_stapling_verify on;
        ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5;
        resolver 8.8.8.8 8.8.4.4;
        ssl_dhparam /etc/nginx/dhparams.pem;
        add_header Strict-Transport-Security "max-age=31536000; always";

        location / {
                try_files $uri $uri/ /index.php?$args;

# Announcements
rewrite ^/announcements/([0-9]+)/[a-zA-Z0-9-]+.html$ /./announcements.php?id=$1 last;
rewrite ^/announcements$ /./announcements.php last;

# Downloads
rewrite ^/downloads/([0-9]+)/([^/]*)$ /./downloads.php?action=displaycat&catid=$1 last;
rewrite ^/downloads$ /./downloads.php last;

# Knowledgebase
rewrite ^/knowledgebase/([0-9]+)/[a-zA-Z0-9-]+.html$ /./knowledgebase.php?action=displayarticle&id=$1 last;
rewrite ^/knowledgebase/([0-9]+)/([^/]*)$ /./knowledgebase.php?action=displaycat&catid=$1 last;
rewrite ^/knowledgebase$ /./knowledgebase.php last;
        }
   
   
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
        fastcgi_index index.php;
        fastcgi_read_timeout 300;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                expires max;
                log_not_found off;
        }
   
   

    location = /favicon.ico {
                log_not_found off;
                access_log off;
        }

        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }

    location ~* error.log {
        deny all;
    }

    location ~ /\. {
    deny all;
    }

}


server {
    listen 80;
    server_name clientarea.host.host;
    rewrite ^ https://clientarea.host.host$request_uri permanent;
}

Dan jangan lupa cantumkan https di general settings whmcsnya :D
 
Status
Not open for further replies.

Top