0

I contact you since I have a little problem with my code igniter. I have a .htaccess that rewrites urls. For example when I click on contact, the url shows and loads : localhost:8888/my_site/contact but the page stays the same I was on.

So I do not really understand what is going on ?

Did you already have the same problem ?

Do you have an idea ?

Thanks in advance for your help guys :)

Here is my htaccess file (which is loaded correctly, I tried adding a random line and it displays an error so its fine) :

Options +FollowSymlinks -Indexes
RewriteEngine On
#RewriteBase /

## in case the URL is not an actual FILE
RewriteCond %{REQUEST_FILENAME} !-f

## or an actual directory
RewriteCond %{REQUEST_FILENAME} !-d

## send everything to the index, for MVC
RewriteRule ^.*$ ./index.php

DirectoryIndex index.php index.html
  • check this https://stackoverflow.com/questions/38122186/set-up-the-base-url-in-codeigniter/38122321#38122321 – Abdulla Nilam Mar 19 '18 at 11:05
  • Thanks for your fast answer. My indexpage in config is already set to : ' ' When I changed the htaccess as described in your topic my page shows 404 not found. And this htaccess is not good anyways. –  Mar 19 '18 at 11:14
  • use the htaccess which I mentioned there – Abdulla Nilam Mar 19 '18 at 11:15
  • The htaccess you mentioned makes 404 error on my website :/ –  Mar 19 '18 at 11:17
  • No way. Its the common htaccess and that's the what I used since 2-3 years – Abdulla Nilam Mar 19 '18 at 11:18
  • I'm sorry I was letting one last line of my own htaccess which was doing yours bug. Now I replaced my entire htaccess with yours, and I get no bug, but still exactly the same problem. –  Mar 19 '18 at 11:22
  • post your contrller code and view code – Abdulla Nilam Mar 19 '18 at 11:41
  • I have so many views and controller I cannot upload each one of them, and the problem is the same with everyone of them and the project works for other members of the team so the problem does not come from the view or controller I can tell you. It's about url rewriting, mamp or my localhost or whatever… I start being desperated since I have been on this for so long now... –  Mar 19 '18 at 17:51

1 Answers1

0

try this .htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L]
Terchila Marian
  • 2,225
  • 3
  • 25
  • 48
  • Doesn't work either :( I'm trying to do a fresh install from scratch, now I got this problem on the new install : When I click on the link student for exemple, I receive not found (on the new fresh install i just made) http://localhost:8888/localhost:8888/my_site/procedure/student –  Mar 20 '18 at 10:41