1

My htaccess

RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|uploads|images|ws|vendor|css|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

I have also hidden my index.php

Fails to load: - https://www.abc.in/abc-xyz-fdg

Works: - https://www.abc.in/index.php/abc-xyz-fdg

6
  • Did you change base_url in config.php file $config['base_url']. Commented Sep 25, 2018 at 10:52
  • Please check this on page stackoverflow.com/questions/42625147/… Commented Sep 25, 2018 at 10:56
  • @BalasahebBhise this did not work too Commented Sep 25, 2018 at 11:21
  • @GufranHasan $config['base_url'] = "https://www.abc.in/" Commented Sep 25, 2018 at 11:25
  • @shasha1589, yes right, you can also try this solution sajjadhossain.com/2008/10/27/ssl-https-urls-and-codeigniter Commented Sep 25, 2018 at 11:27

3 Answers 3

1

Try this

RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Sign up to request clarification or add additional context in comments.

Comments

0

You need to make changes in two files.

  1. config.php file $config['secure_base_url']=" https://www.abc.in/";

  2. And open the url_helper.php file (system/helpers/url_helper.php) and alter the code in https://sajjadhossain.com/2008/10/27/ssl-https-urls-and-codeigniter/

  3. Now, add the following code in Config.php file (system/Core/Config.php) as in https://sajjadhossain.com/2008/10/27/ssl-https-urls-and-codeigniter/

reference

8 Comments

(system/libraries/Config.php) I do not have this file?
Which version of CI you are using?
If you are using latest version v3.1.9then it would be in system/Core/Config.php.
I am Using 3.1.9. I just downloaded a new version of CI to Check if file was missing in mine. Its not there in the new download.
I made the necessary changes, but still not help
|
0

This worked for me.

Step 1

SSL config (which runs with https)

<Directory "/var/www/html">
   AllowOverride All
</Directory>

Step 2

The .htaccess file should be like this...

RewriteEngine On
RewriteCond %{HTTPS} !=on      
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [L]
</IfModule> 

Reference link : HTTPS and Remove index.php on CodeIgniter

Thank you guys who tried to him me

Happy Coding!!

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.