-1

How to redirect non www and http to https with www via htaccess? I want to redirect old folder to home page like http://.test.com/test1/about.php to https://www.test.com

2 Answers2

0

Put these line in your .htaccess file in root directory of your webserver:

Redirect 301 /test1/about.php to https://www.test.com

Also make sure that you haven't disable .htaccess in your apache config.

0

Try this conf one on your server configuration :

 RewriteEngine On
 RewriteCond %{HTTP_HOST} !^www\. [NC]
 RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
 RewriteCond %{SERVER_PORT} !^443$
 RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [L,R=301]
black4bird
  • 617
  • 1
  • 5
  • 13