1

i'm having an problem with the URL of Codeigniter. When i use one controller with parameter, example: localhost/ci/products/news (where localhost/ci is the url base), after i click in any element <a />, example: <a href="home"/> Codeigniter redirects for localhost/ci/products/home and no for localhost/ci/home.

Anyone know why this happens?

vaati
  • 162
  • 2
  • 13

1 Answers1

1

You must use a base_url for links. Right now your anchor has a relative path in the href="home", you should have full path in your links, when u use mod_rewrite for nice urls.

like

 <a href="https://your.server/ci/home">Home </a>
Lauri Orgla
  • 561
  • 3
  • 10
  • If this answer solved you problem, then please accept the solution. There are many questions in stackoverflow that have been resolved but not accepted. – Lauri Orgla Sep 11 '14 at 20:10