Welcome Guest, Not a member yet? Register   Sign In
urls / image urls
#1

[eluser]MWebber[/eluser]
Hi,
I'm new to CodeIgniter. I have strange problem with the links.

example : i go to Register controller and i press in the menu link to Login controller it's redirects me to http://example.com/register/login. what can i do for the url it to send me to http://example.com/login and http://example.com/register (without site_url() if its possible ). Same for the images - in register controller they load normally but in login controller they point to http://example.com/register/login/images...

images dir is in root dir.

All help is appreciated Smile
#2

[eluser]Razedd[/eluser]
go to
system/application/config/config.php
There you can set the base url.
That should do it i think

Greetings,
Razedd
#3

[eluser]MWebber[/eluser]
can it be done with routes?
#4

[eluser]Mr. Pickle[/eluser]
You can autoload the url helper and use

Code:
<?php
     anchor('login','Click here to login','class="login"');
?>
#5

[eluser]Razedd[/eluser]
[quote author="Razedd" date="1284129083"]go to
system/application/config/config.php [/quote]


As i said go to config.php and change the:
Code:
$config['base_url']    = "http://example.com/";

to youre own url, for me that is this

Code:
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|    http://example.com/
|
*/
$config['base_url']    = "http://localhost/Code_igniter/";

/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = "index.php";
#6

[eluser]MWebber[/eluser]
Thank you all for the help i found my solution here


http://ellislab.com/forums/viewthread/66887/#329207

Code:
<base href="<?php echo $this->config->item('base_url') ?>www/" />
(its placed in head tag)

this row configures all paths in the template and works perfectly

P.S Thanks Razedd and Mr. Pickle this solutions helped me too




Theme © iAndrew 2016 - Forum software by © MyBB