madeye
madeye

Reputation: 1406

Links on codeigniter website broken on new server

I've switched my codeigniter website to a new webhost recently and now all links on the site are broken. Every time i click on one of them website only redirects to index.php. Everything worked on old server without any problems. I don't know very much about servers, problem is that it's shared hosting and i don't have any access to conf files in /etc/apache2 directory.

My .htaccess file is

<IfModule mod_rewrite.c>

    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]

</IfModule>

<IfModule !mod_rewrite.c>

    # Without mod_rewrite, route 404's to the front controller
    ErrorDocument 404 /index.php

</IfModule>

Any help would be very much appreciated. Thank you!

Upvotes: 2

Views: 138

Answers (1)

Jon Lin
Jon Lin

Reputation: 143856

It's probably redirecting everything to /index.php because you've got your 404 error document routing to it:

ErrorDocument 404 /index.php

That would seem to indicate that mod_rewrite isn't turned on on your new webhost. You need to contact support and see about getting the rewrite module turned on.

Upvotes: 5

Related Questions