CodeIgniter Forums
CodeIgniter redirect to localhost after online migration - 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: CodeIgniter redirect to localhost after online migration (/showthread.php?tid=63680)

Pages: 1 2


CodeIgniter redirect to localhost after online migration - JackIlpazzo - 11-27-2015

I just uploaded my application on my hosting account, the account is provided by Hostinger. You can see the link here.

Configuration file:
Code:
<?php
class SystemConfiguration {
// General Settings
public static $base_url    = 'http://primodebug.esy.es/Calendario/';
// Database Settings
public static $db_host     = 'mysql.hostinger.it';
public static $db_name     = 'u460105738_primo';
public static $db_username = 'u460105738_ferve';
public static $db_password = '*****';

CodeIgniter config.php file (It's too long to paste here).

.HTACCESS

Code:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

I also have other problems logging probably related files .httaccess I have no idea, but it seems that some javascript files are not loaded properly. What can be?


RE: CodeIgniter redirect to localhost after online migration - arma7x - 11-27-2015

Try manually replace base_url value in config.php


RE: CodeIgniter redirect to localhost after online migration - JackIlpazzo - 11-27-2015

(11-27-2015, 08:10 AM)arma7x Wrote: Try manually replace base_url value in config.php

Hi there, thanks for the reply. I've changed like so:

PHP Code:
$config['base_url'] = "http://primodebug.esy.es/Calendario/"

but how you can see the app still go in localhost...


RE: CodeIgniter redirect to localhost after online migration - arma7x - 11-27-2015

What is your default controller? Request to http://primodebug.esy.es/Calendario always redirect to http://localhost/Calendario/user/login. Try check your default controller. Another question, why put your web based folder in public_html??


RE: CodeIgniter redirect to localhost after online migration - JackIlpazzo - 11-27-2015

(11-27-2015, 09:26 AM)arma7x Wrote: What is your default controller? Request to http://primodebug.esy.es/Calendario always redirect to http://localhost/Calendario/user/login. Try check your default controller. Another question, why put your web based folder in public_html??

I put the application "Calendario" folder in public_html 'cause in the root of the system there's a file the specific 'do not upload file here'. Why this question? As you saw in my configuration file I call this variable: 

PHP Code:
$config['base_url']    = SystemConfiguration::$base_url

the content of this variable is:  http://primodebug.esy.es/Calendario
I've also try to change into:

PHP Code:
$config['base_url'] = "http://primodebug.esy.es/Calendario" 

But still redirect on localhost..

UPDATE:

If I insert this url: http://primodebug.esy.es/Calendario/user/login

The application login is loaded correctly but if I try to login with this credential:

Username: Test
password: 123456789

(just for debug scope).

Seems that the server doesn't return any data response.. But I've checked the login is performed successfully.


RE: CodeIgniter redirect to localhost after online migration - arma7x - 11-27-2015

My question is what is your default controller? Request to http://primodebug.esy.es/Calendario always redirect to http://localhost/Calendario/user/login. Try RECHECK YOUR DEFAULT CONTROLLER IF YOU HAVE CONDITION THAT CAUSE USER TO REDIRECT TO LOGIN PAGE AND DOES THE REDIRECTION LINK IS CORRECT. Put index.php & assets in your public_html. SYSTEM AND APPLICATION FOLDER you can put in same directory as index.php but for safety put in below directory of index.php


RE: CodeIgniter redirect to localhost after online migration - JackIlpazzo - 11-27-2015

(11-27-2015, 10:50 AM)arma7x Wrote: My question is what is your default controller? Request to http://primodebug.esy.es/Calendario always redirect to http://localhost/Calendario/user/login. Try RECHECK YOUR DEFAULT CONTROLLER IF YOU HAVE CONDITION THAT CAUSE USER TO REDIRECT TO LOGIN PAGE AND DOES THE REDIRECTION LINK IS CORRECT. Put index.php & assets in your public_html. SYSTEM AND APPLICATION FOLDER you can put in same directory as index.php but for safety put in below directory of index.php

Okay I solved the problem of the localhost, now if you try to achieve the following url:

http://primodebug.esy.es/Calendario/

you can see that it works. But there remains the problem of the login, locally it works fine, but here it seems that the files are uploaded to the network tab I get no answer, I will probably require a change to the .htaccess file?


RE: CodeIgniter redirect to localhost after online migration - arma7x - 11-27-2015

I'm still having redirect issue to http://localhost/Calendario/user/login when click http://primodebug.esy.es/Calendario/


RE: CodeIgniter redirect to localhost after online migration - JackIlpazzo - 11-27-2015

(11-27-2015, 11:35 AM)arma7x Wrote: I'm still having redirect issue to http://localhost/Calendario/user/login when click http://primodebug.esy.es/Calendario/

I've noticed, the problem is back but do not know why when I reloaded the files everything worked. I think it's a problem of .htaccess files, but do not know how to configure it, you can help solve?


RE: CodeIgniter redirect to localhost after online migration - arma7x - 11-27-2015

The problem occur when redirect to login page which mean your auth system? Did you use community auth or tank auth? Or using your own auth system?