Remove index.php and force redirect HTTPS

HTTPS provides authentication of the website and associated web server with which one is communicating, which protects against man-in-the-middle attacks.

Additionally, it provides bidirectional encryption of communications between a client and server, which protects against eavesdropping and tampering with or forging the contents of the communication.
HTTPS connections were primarily used for payment transactions on the World Wide Web, e-mail and for sensitive transactions in corporate information systems.

CodeIgniter’s URLs are designed to be search engine friendly and to human too. And so to maintain the standards we need to remove the default index.php which appears in the url of codeigniter applications, so that the url becomes search engine friendly and looks clean.

So if you want to force https on entire website and remove index.php from URL, create a file named .htaccess and just copy and paste the below code

After following this post your website use HTTPS while redirecting and also no index.php appears.