0

I am trying to study codeigniter. I am confused with URL mod_rewrite. I use 2 pages: home.php and about.php in view directory, and call them using controller Site. In both the pages i gave links for it with controller functions home, about respectively:

< a href='home'>Home</a>
< a href='about'>About</a>

when I type the URL as localhost/Project/Site/home and localhost/Project/Site/about it works efficiently. My problem is when I call the URL "localhost/Project" I can get the home.php but after that if I click on any links (Home / About ), the url will be localhost/Project/home and can not access the page.

I am using .htaccess as the direction in the YouTube video

It may be a simple issue but i can't solve it. Please help me.

1 Answer 1

1

prepending the path with a slash will make it link from your root url

I would just give it the path that works, something like:

< a href='/Project/site/home'>Home</a> < a href='/Project/site/about'>About</a>

right now it appends to the current url, as you see what is happening

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.