Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter problem after upload to hosting
#1

Hello! I have problem with CodeIgniter!

When i launch server on XAMPP everything is working good:
[Image: localhost.png]


The problem take place when I put the code to my hosting on nazwa.pl. When I press button "Submit Post!" I get my hosting company page, that my site is hosted on nazwa.pl servers:
[Image: zewnetrzny.png]

I don't know where is the problem, mayby in configuration? 

Thanks for help!
Reply
#2

(This post was last modified: 04-06-2018, 08:26 AM by php_rocs.)

@Griwen,

That's were I would start. Maybe your base_url in your config file or maybe your action parameter in your form tag.
Reply
#3

@php_rocs

a have it in folder and now it's working but i don't know how, I added a line in .htacces:

RewriteBase /folderWithCI/

and in config:

$config['base_url'] = 'http://domain.pl/folderWithCI/';

Don't know why it's not working without that line in htaccess if i have subfolder declarated in baseurl
Reply
#4

(This post was last modified: 04-06-2018, 01:13 PM by jreklund.)

If you do not declare a RewriteBase it will start looking for files at domain.pl, but you have your files in a folder (folderWithCI). So it give you an error message.

If you don't want a folder, specify: RewriteBase /
Reply
#5

Base URL should be absolute, including the protocol:
$config['base_url'] = "http://somesite.com/somedir/";
If using the URL helper, then base_url() will output the above string.

Passing arguments to base_url() or site_url() will result in the following (assuming $config['index_page'] = "index.php";:

echo base_url('assets/stylesheet.css'); // http://somesite.com/somedir/assets/stylesheet.css
echo site_url('mycontroller/mymethod'); // http://somesite.com/somedir/index.php/my...r/mymethod
Reply




Theme © iAndrew 2016 - Forum software by © MyBB