Welcome Guest, Not a member yet? Register   Sign In
[solved] 404 error on production server excepting homepage
#1

(This post was last modified: 03-04-2015, 02:23 AM by Floyd_C.)

In advance, sorry for my french english Angel

Hello world !


This is my third day wasted by searching a solution to this :

My CI work perfectly on my own server, a debian distrib with only the basis and no customization. I first put my site online on OVH... No trouble.

Then, I had to migrate everything on an other host named Oopss, and Bim ! Troubles !!

The homepage only works, on every other uri, the server send me back a 404 error. I try a lot of thing :

- I didn't remove the index.php in uri, for simplicity. I also tried to put some .htaccess files at the root of my site, with no effect, finnally remove it.
- I learn that my host use FastCGI, and turn the app/config/config.php_$config['uri_protocol'] to 'REQUEST_URI' =>No effect (no effect for the other options)
- I tried to change base_url, index_page, I tried to leave it blank, I tried to read the logs... And, at least, I tried to do NOT commit suicide !

Here is my phpinfo()

Since I saw there are many people having this kind of trouble, I strongly advise admin to have a word about this in official doc, Server Requirement part of the doc is definetly no helping !

Any ideas please ?!

I can provide you any information, even my credit card (jokking) !!
Reply
#2

could you show us the .htaccess that didn't work?
Reply
#3

(03-03-2015, 04:36 AM)Avenirer Wrote: could you show us the .htaccess that didn't work?

I have no htaccess anymore. Since I decided to let the index.php/controller/methode structure. Maybe it's a clue to solve my issue... Anyone using the index.php in uri have a htaccess exemple for me ?
Reply
#4

UP : this is a line of my server-error.log :

"/srv/www/nils/htdocs/museeinsolite/index.php/welcome/oeuvres" failed (20: Not a directory)

So I guess than the server send back a 404 error befor CI starts to run. So I may be a server issue, not a CI's one.

(Plus : My CI log only show the home page execution, wich is perfectly works)
Reply
#5

Hi Floyd,

Let see those ideas :

First, when you delete a htaccess file , don't forget to clean refresh your page with pressins ctrl + F5.
Otherwise, your page will dusplay your local version of the page !

Let's show us your htaccess file ! It could be really helpful.

When using htaccess did you checked if mod_rewrite was "on" on your apache server. Check if the php is too !

If you try to do not use url rewriting, check the internal links of your website. They are propably mispelled !

Tell us what happens now.

(Je suis Francais aussi Smile )
Reply
#6

Hello Floyd_C,

Ca fait plaisir un petit Français de plus ici Cool

Although I'm french too, I will answer in english : I'm not aware of FastCGI technology but I found this article (from another french, they're everywhere !) which might be useful to solve your problem !

Keep in touch Wink
Reply
#7

Hi,

You have to add following lines in your .htaccess file

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
Reply
#8

(This post was last modified: 03-04-2015, 02:26 AM by Floyd_C.)

Hi All !


Thanks to $this !!


The server uses Nginx !

So : it doesn't read .htaccess ; the server needed a [ php_redirect_to_index ] command on my main directory ; and, just in case, this server need a special configuration for a wordpress and other .htaccess requierement

And I strongly recommand to check http://wiki.nginx.org/Codeigniter to resolve this issue.

Using all those thing, you'll be able to remove all index.php from your uri, without using an .htaccess file.

As my host says, Nginx is in a good way to replace Apache on all server around the world. I don't if its true, but nevermind, my problem is solved.

As I said in my original post, I strongly advise CodeIgniter team to add a word on the official doc about Nginx, just in case...

Thank you all again !
Kiss
Reply




Theme © iAndrew 2016 - Forum software by © MyBB