Redirect HTTP with www to HTTPS without www
hi
Please help me
I need that my website is displayed only over SSL . Only
and Remove www
Only settings for file ".htaccess"
for all addresses and sub-folders
For example:
end result: Remove www and display website over https
Please give three answers : 1: # Redirect HTTP without www to HTTPS without www 2: # Redirect HTTP with www to HTTPS without www 3: # Redirect HTTPS with www to HTTPS without www
1: # Redirect HTTP without www to HTTPS without www
http://domain.com/
http://domain.com/wp-login.php
2: # Redirect HTTP with www to HTTPS without www
http://www.domain.com/
http://www.domain.com/wp-login.php
3: # Redirect HTTPS with www to HTTPS without www
https://www.domain.com/
https://www.domain.com/wp-login.php
end result: Remove www and display website over https
https://domain.com/
https://domain.com/wp-login.php
Please give three answers : 1: # Redirect HTTP without www to HTTPS without www 2: # Redirect HTTP with www to HTTPS without www 3: # Redirect HTTPS with www to HTTPS without www
-
Hi, For your first two queries login to cPanel and click on Redirects option in Domains Section and * Select Type Permanent (301) * Select your domain (i.e. sample.com) (Leave the box empty after selecting domain from drop down) * redirectes to --> 1: # Redirect HTTP without www to HTTPS without www RewriteCond %{HTTP_HOST} ^domain.com$ RewriteRule ^/?$ "https\:\/\/domain\.com\/" [R=301,L] 2: # Redirect HTTP with www to HTTPS without www RewriteCond %{HTTP_HOST} ^www\.domain\.com$ RewriteRule ^/?$ "https\:\/\/domain\.com\/" [R=301,L] 3: # Redirect HTTPS with www to HTTPS without www You mean Unfortunately I don't know any htaccess rule for this redirection. IMO, you should set php redirection for this type of redirection. Or someone else can provide you solution for this. Thanks 0 -
thanks... 0 -
Thanks But not all-encompassing perspective http://domain.com/wp-login.php http://www.domain.com/wp-login.php https://domain.com/wp-login.php https://www.domain.com/wp-login.php
So what is the answer? Please test, be sure to completely delete your browser's cache thanks but this Redirects for main pages is good :RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.(.*) RewriteRule ^.*$ https://%1/$1 [R=301,L] RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
but for wordpress in each is good :RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]0 -
Thanks 0
Please sign in to leave a comment.
Comments
5 comments