Welcome Guest, Not a member yet? Register   Sign In
site_url() and base_url() not working ?!
#1

[eluser]Jan_1[/eluser]
I've just uploaded my files from localhost to a new server.
site_url() and base_url() are not working. I don't know why.
Has anybody a good hint or question what I could check?
Have tryed a lot, but it did not help. :-( What could I do?

Codeigniter is in no subfolder on the server
.htaccess :
Code:
RewriteEngine on
RewriteBase /

# Prevent CI index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php?/$0 [PT,L]

# Prevent user access to the CI system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

# Prevent user access to the CI application folder
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

SetEnvIf Request_URI "(http://www.mydomain.com/assets)$" allow

application/config/config:
Code:
$config['base_url'] = 'http://www.mydomain.com/';
$config['index_page'] = '';

application/config/autoload:
Code:
$autoload['helper'] = array('url','form','html');

php_info:

PHP Version 5.3.3
System Linux
#2

[eluser]Jan_1[/eluser]
Server does not accept <code>&lt;?=base_url()?&gt;</code> but <code>&lt;?php echo base_url(); ?&gt;</code>

So
Code:
php_flag short_open_tag on
in .htaccess or in php.ini could fix it.




Theme © iAndrew 2016 - Forum software by © MyBB