Point #1 If I type:
www.myurl.com/somepage
http://www.myurl.com/somepage
http://myurl.com/somepage
https://myurl.com/somepage
have it redirect to
https://www.myurl.com/somepage
Point #2
When I type in something like www.myurl.com it is redirecting to https://www.myurl.com/index.php.
Make it so the index.php is not displaying. It should just display https://www.myurl.com
From Comment htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^myhost\.com$ [NC]
RewriteRule ^(.*)$ myhost.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /index\.php(/[^\ ]*)?\ HTTP/
RewriteRule ^index\.php(/(.*))?$ myhost.com/$2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
I tried above all ones but they did not work properly in my case. I found below solution, it works in my case. I hope it will be helpful for you as well.
yes indeed this
works but you have to make a slight edit. In the
codeiginiterfolder/application/config.php
file replacehttp
withhttps
.Also, the base url in the above code you have to replace the
myhost
to your host name. Suppose my host nameinternetseekho.com
so instead ofmyhost
you do have writeinternetseekho
.If you find the error "No Input file specified" then add "?" in the last line
in the answer from @asiya khan
First go to the application/config/config.php file and look for this line:
Set it to your URL with the https e.g.
https://example.com
Then go to your
.htaccess
file and add this line in the example given below.RewriteRule ^(.*)$ https://example.com/$1 [R,L]
Please Check this may help
Config changes :- Go to “application/config/config.php” and enable or set hooks to true.
create a new file named hooks.php in “application/config/hooks.php” and add below code in hooks.php:-
Now create a new directory with named “hooks” under application directory and then create new file named “ssl.php” in “application/hooks/ssl.php” and add below code to “ssl.php” :-
for me none of the above answer worked as it was showing me too many redirects but this one worked like charm. Hence I thought to share if someone else get into the similar issue: