CodeIgniter Forums
problem with htacces and https - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: problem with htacces and https (/showthread.php?tid=68206)



problem with htacces and https - kozebobinka - 06-09-2017

Hello
I've made simple htacess from manual:
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

If I coming via http - it works
If I coming via https - it works, but changes the address in address line from https://example.com/zzz/ to https://example.com/index.php/zzz/ 

Code:
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

What can I do to remove this "index.php" from https links?


RE: problem with htacces and https - skunkbad - 06-09-2017

(06-09-2017, 02:21 AM)kozebobinka Wrote: Hello
I've made simple htacess from manual:
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

If I coming via http - it works
If I coming via https - it works, but changes the address in address line from https://example.com/zzz/ to https://example.com/index.php/zzz/ 

Code:
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

What can I do to remove this "index.php" from https links?

Try this .htaccess:


Code:
RewriteEngine On
RewriteBase /

# Entire site is secure
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://your-website.com/$1 [R,L]

RewriteRule ^(system|application|cgi-bin) - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]



RE: problem with htacces and https - kozebobinka - 06-13-2017

It's work! Thank you so much!


RE: problem with htacces and https - jackey - 07-01-2017

this is the .htaccess file i used for my project in my localhost.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /test_abc/

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ ./index.php?/$1 [L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ ./index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?/$1 [L]

RewriteCond %{REQUEST_URI} ^(index.php|images|css|fonts|js|robots.txt)
</IfModule>

here test_abc is the folder name in my localhost.
when i type http://localhost/test_abc in the browser,it works properly in my localhost.

when i upload the content from my localhost into 000webhost.com server
i did the changes

in .htaccess file
RewriteBase into RewriteBase /http://www.example.com/

in config.php
$config['base_url'] = 'http://www.example.com/';
$config['index_page'] = '';

in routes.php
$route['default_controller'] = 'Login';

database.php file is ok

I can see the login page in 000webhost.com server properly, but when i try to login, it says "500 internal server error".

I'm new to this area and unable to handle this issue.
Is there any other changes i have to do here?
can any one please help me to upload my web site.


RE: problem with htacces and https - Paradinight - 07-02-2017

(07-01-2017, 08:16 PM)jackey Wrote: this is the .htaccess file i used for my project in my localhost.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /test_abc/

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ ./index.php?/$1 [L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ ./index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?/$1 [L]

RewriteCond %{REQUEST_URI} ^(index.php|images|css|fonts|js|robots.txt)
</IfModule>

here test_abc is the folder name in my localhost.
when i type http://localhost/test_abc in the browser,it works properly in my localhost.

when i upload the content from my localhost into 000webhost.com server
i did the changes

in .htaccess file
RewriteBase into RewriteBase /http://www.example.com/

in config.php
$config['base_url'] = 'http://www.example.com/';
$config['index_page'] = '';

in routes.php
$route['default_controller'] = 'Login';

database.php file is ok

I can see the login page in 000webhost.com server properly, but when i try to login, it says "500 internal server error".

I'm new to this area and unable to handle this issue.
Is there any other changes i have to do here?
can any one please help me to upload my web site.

500 is a server error. check the error log file


RE: problem with htacces and https - Diederik - 07-02-2017

Most likely caused by a syntax error / typo in your htaccess file.


RE: problem with htacces and https - PaulD - 07-02-2017

Quote:RewriteBase into RewriteBase /http://www.example.com/

You have a forward slash before your http in your post above, have you put this in your .htaccess file too? Take it out.


RE: problem with htacces and https - jackey - 07-02-2017

(07-02-2017, 01:08 PM)PaulD Wrote:
Quote:RewriteBase into RewriteBase /http://www.example.com/

You have a forward slash before your http in your post above, have you put this in your .htaccess file too? Take it out.

Thank you very much for your support. Now it's working.