deepakk Posted February 13, 2015 Share Posted February 13, 2015 How can i able to redirect my website to https://www.mydomain.in If someone visit simple mydomain.in & someone www.mydomain.in How can i able to redirect both the above address to https://www.mydomain.in please help me with the .htaccess file redirectin code in php. with apache server Link to comment https://forums.phpfreaks.com/topic/294582-redirection-my-site-to-https/ Share on other sites More sharing options...
brotherZ Posted February 13, 2015 Share Posted February 13, 2015 RewriteCond %{SERVER_PORT} !=443 RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC] RewriteRule ^(.*)$ https://www.domain.com/$1 [R,L] Link to comment https://forums.phpfreaks.com/topic/294582-redirection-my-site-to-https/#findComment-1505636 Share on other sites More sharing options...
tampaphp Posted May 9, 2015 Share Posted May 9, 2015 RewriteEngine on# if a directory or a file exists, use it directlyRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-d# otherwise forward it to index.phpRewriteRule . index.phpRewriteEngine OnRewriteCond %{SERVER_PORT} 80RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R,L] Link to comment https://forums.phpfreaks.com/topic/294582-redirection-my-site-to-https/#findComment-1511225 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.