CodeIgniter Forums
Error 404 on the server side (no error on local) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Error 404 on the server side (no error on local) (/showthread.php?tid=35110)



Error 404 on the server side (no error on local) - El Forum - 10-19-2010

[eluser]Toams[/eluser]
Hi,
I am new in CI. I started a new web site with CI.
Sorry for my bad english Smile
I have an error. On local all is ok.
I put my website on a directory on the server.
(www/dev/mysite)
but when I write in a browser www.mysite.fr/dev/mysite, I have an error 404.
Do you have any ideas ?
All the files are the same (local/web).
Thank you for your help.


Error 404 on the server side (no error on local) - El Forum - 10-19-2010

[eluser]Bart v B[/eluser]
Did you also edit in your /config/config.php
$config['base_url'] = http://www.mysite.fr/dev/mysite/
Wink


Error 404 on the server side (no error on local) - El Forum - 10-19-2010

[eluser]Toams[/eluser]
Even with this line in the config file, I have an 404 error


Error 404 on the server side (no error on local) - El Forum - 10-20-2010

[eluser]Toams[/eluser]
Always impossible to have my first pagge. I have an 404 error.
I've changed my config file, and put the good base url.


Error 404 on the server side (no error on local) - El Forum - 10-20-2010

[eluser]Bart v B[/eluser]
And how is your .htaccess looking Wink

I think that you need some modefication also there..

Because as how i see it you have a folder used for your website. So you need to say to apache that your application is in that folder..

<IfModule mod_rewrite.c>
RewriteEngine On

# normaly you use: RewriteBase /
RewriteBase /mysite/
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

ErrorDocument 404 /index.php
</IfModule>


Error 404 on the server side (no error on local) - El Forum - 10-20-2010

[eluser]Toams[/eluser]
Ok, thank you for that...
where I should write this code ?
I will test as soon as I know where I sould put this code...


Error 404 on the server side (no error on local) - El Forum - 10-20-2010

[eluser]Bart v B[/eluser]
Just place it in a .htacces file.
upload it in your directory where your index.php is.
That should be in your case in the mysite folder Wink


Error 404 on the server side (no error on local) - El Forum - 10-20-2010

[eluser]Toams[/eluser]
<IfModule mod_rewrite.c>
RewriteEngine On
# normaly you use: RewriteBase /
RewriteBase /dev/
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#‘system’ can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn’t true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
# If we don’t have mod_rewrite installed, all 404’s
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

ErrorDocument 404 /index.php
</IfModule>

I put this in the folder ,
but 404 error Sad


Error 404 on the server side (no error on local) - El Forum - 10-21-2010

[eluser]Bart v B[/eluser]
ok... were back..

Can you give some more info aboute how your ci installation is standig?

Do you have php on your server?

Can you show us how your setup is?

i mean the folders?
Do you have a controller called mysite?
Do you have isapi installed? (something link apache modrewrite)
A clean install of codeigniter? what gives that for example?