I have SSL issued to website and when https://website.tld is visited it work but does not for www.website.tld or website.tld
Can some help me to resolve this.
I have SSL issued to website and when https://website.tld is visited it work but does not for www.website.tld or website.tld
Can some help me to resolve this.
You need to add redirect code in your htaccess file
If you want your domain to be with www, use this below code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
If you want your domain to be visited without www, then use this below code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.(.)$ [NC]
RewriteRule ^(.)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Thank you.
Iām will do this.
Is there a way I can do this maybe through CLI? I am unable to find the .htaccess file in the file manager, I guess a feature to show hidden files will be needed for file manager.
Filemanager shows hidden files too in Cyberpanel by default. Infact there is no option I see to hide hidden files
Just create new file named .htaccess and then copy paste the code I provided in previous message.
Thank you for this.