1
votes

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

3
Did you change base_url in config.php file $config['base_url'].Gufran Hasan
@BalasahebBhise this did not work tooshasha1589
@GufranHasan $config['base_url'] = "https://www.abc.in/"shasha1589
@shasha1589, yes right, you can also try this solution sajjadhossain.com/2008/10/27/ssl-https-urls-and-codeigniterGufran Hasan

3 Answers

1
votes

Try this

RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
0
votes

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

0
votes

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!!