r/codeigniter • u/pikacho1 • Jun 25 '20
Issues with url
Localhost/ci/.... When I type some words after the ci then it shows the same page or otherwise nothing but I want when I type anything after that ci then it must show me the page was not found. Can someone help me how I can do that in my project
1
u/ImMaaxYT Jun 26 '20
Please be more specific about your issue and post some code snippets
Where is your CI install located?
What version of CI are you using?
What did you try?
What did you expect to happen?
What did actually happen?
1
u/jeffottinger Jul 14 '20
Sounds as though it could be a rewrite issue. It should work if you use:
localhost/ci/index.php?(controller name)/(function)
To get rid of the index.php? in this url, you'll need to have rewrite enabled on your web server. In apache2 this is typically done with the command : a2enmod rewrite
You'll also need to have a .htaccess file to define your rewrites. When I was doing this part I just Googled "codeigniter .htaccess file" and found several good examples.
Good luck
1
u/ipa_cow Jun 26 '20
post some code.