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 Quote 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] Quote 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] Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.