• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
N00b having troubles with links...

#1
[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?

#2
[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-gui.../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

#3
[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

#4
[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.

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

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

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.