creating https over http on localhost |
Hi
if i tried to login using url localhost/ci/index.php/users/auth/login it redirect to https://localhost/ci/index.php/users/auth/login I removed .htaccess file. How to redirect it to http my $config['base_url'] = 'http://localhost/ci'; Anybody knows how to fix this ? I need http not https problem area is if the images, jquery and other resources are not loaded everything gets failed because browser console shows the following error. Mixed Content: The page at 'https://localhost/ci/index.php/users/auth/login' was loaded over a secure connection, but contains a form which targets an insecure endpoint 'http://localhost/ci/index.php/users/auth/login'. This endpoint should be made available over a secure connection. I read the CodeIgniter 3.0.3 feature Changed Config Library method base_url() to fallback to $_SERVER['SERVER_ADDR'] when $config['base_url'] is empty in order to avoid Host header injections. using the following code <link href="<?= base_url() ?>assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
SOLVED I was using XAMP and OpenSSl was installed it was making this mistake. Finally it was spoted out commented that line and it started working. I still had Ubuntu laptop will check on it. In case anybody facing the error i commented line from C:\XAMP\apache\conf\httpd.conf
# Include conf/extra/httpd-ssl.conf stop apache service and restart.
The error you were getting is caused by loading the assets (scripts, styles, images, etc.) over HTTP when you're loading the page over HTTPS. You didn't solve the problem, you just removed the ability to have a secure connection from your development server.
In order to solve the problem, you have to either load your assets using HTTPS when your page is loaded via HTTPS, or always load them via HTTPS. |
Welcome Guest, Not a member yet? Register Sign In |