CodeIgniter Forums
N00b having troubles with links... - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: N00b having troubles with links... (/showthread.php?tid=11033)



N00b having troubles with links... - El Forum - 08-22-2008

[eluser]cyberbuff[/eluser]
Hello all!
First a BIG thanks to Rick Ellis for such a great framework.
I am a newbie with codeigniter and somewhat a newbie with php. (Learnt it myself and in a month) I am having a problem with linking pages. I have a global header. Some links are there. My problem is that I can't set it to static pages. I mean if it's on the domain level then ok. But if it's not the links are getting wrong. I tried with setting a base_url in the config.php file and adding url to the helper library. But it doesn't work.

I have the following links: Home (index), Login (/login), Register (/register) and some other...
also on the homepage...it's only showing a 127.0.0.1/login instead of 127.0.0.1/index.php/login. Am i missing something? or being a dumbo?


N00b having troubles with links... - El Forum - 08-22-2008

[eluser]Randy Casburn[/eluser]
Hey cyberbuff and welcome to a great place to be!

To start off, I hate to send you back to the docs, but I think that might be where your answer is. Try reviewing this page http://ellislab.com/codeigniter/user-guide/general/urls.html and see if that clears things up a little.

If not, come back and clarify what you mean using the terms on that page and we'll get things going for you.

Randy


N00b having troubles with links... - El Forum - 08-23-2008

[eluser]cyberbuff[/eluser]
thanks Randy. I forgot to mention i tried with .htaccess and it gives me an error 500. I put the .htaccess file in the root folder.
Regards


N00b having troubles with links... - El Forum - 08-23-2008

[eluser]Dan Decker[/eluser]
Are you using
Code:
echo anchor();
in your links? With the anchor function from the url helper you build your url thusly;
Code:
echo anchor('controller/function');

Hope this helps.


N00b having troubles with links... - El Forum - 08-23-2008

[eluser]cyberbuff[/eluser]
Daniel, thanks for the tip. I will try with it.


N00b having troubles with links... - El Forum - 08-24-2008

[eluser]jrad[/eluser]
try pasting your .htaccess file here. maybe there's something wrong in the URLs you specified there..


N00b having troubles with links... - El Forum - 08-25-2008

[eluser]cyberbuff[/eluser]
i just put:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]