Welcome Guest, Not a member yet? Register   Sign In
Help! my CI project don't work in the server !!
#1

[eluser]josepichu[/eluser]
Hi! this is my first project in CI.

i have a virtual machine with CentOS, apache and MySQL.
the address of de host is like that 192.168.2.127

In local i use wamp server and i have no problems, I work in a subfolder like http://localhost/guaguas/ and in the server the same 192.168.2.127/guaguas/

But in the server, my applicacon show me the index.php but no links work's

This is my config file.
Code:
$config['base_url'] = 'http://192.168.2.127/guaguas/';
$config['index_page'] = '';

and my .htaccess (removing index.php) the same as recommended

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /guaguas/

    #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]

    #When your application folder isn't in the system folder
    #This snippet prevents user access to the application folder
    #Submitted by: Fabdrol
    #Rename 'application' to your applications folder name.
    RewriteCond %{REQUEST_URI} ^application.*
    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 have followed the mod_rewrite official wiki (http://codeigniter.com/wiki/mod_rewrite) but my project don't work Sad.

I think the problem is in the .htaccess!

Thanks!!!


#2

[eluser]LifeSteala[/eluser]
Hi,
Let's try and simplify your .htacess file just to get it working before we try to optimize and/or secure everything. When I simplify, for testing purposes, my .htaccess file contains the following:

Code:
RewriteEngine On
RewriteBase /guaguas/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Copy the above into yours removing what you have. I'd recommend you take a backup of what you have first.

Another place to look would be your web server log files. If you run apache, find 'error_log' and check for any errors there.

If all the above fails, remove your .htaccess file completely and set the following configuration value. Test that the CI site works without any kind of URL rewriting. (Generally this should work).

Code:
$config['index_page'] = 'index.php';

Good Luck
#3

[eluser]CodeIgniteMe[/eluser]
You should also check you phpinfo() if your apache server has mod_rewrite installed and enabled.
#4

[eluser]josepichu[/eluser]
[quote author="CodeIgniteMe" date="1334049309"]You should also check you phpinfo() if your apache server has mod_rewrite installed and enabled.[/quote]

Yes, i have checked it!my server has mod_rewrite loaded.
#5

[eluser]josepichu[/eluser]
[quote author="LifeSteala" date="1334047136"]Hi,
Let's try and simplify your .htacess file just to get it working before we try to optimize and/or secure everything. When I simplify, for testing purposes, my .htaccess file contains the following:

Code:
RewriteEngine On
RewriteBase /guaguas/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Copy the above into yours removing what you have. I'd recommend you take a backup of what you have first.

Another place to look would be your web server log files. If you run apache, find 'error_log' and check for any errors there.

If all the above fails, remove your .htaccess file completely and set the following configuration value. Test that the CI site works without any kind of URL rewriting. (Generally this should work).

Code:
$config['index_page'] = 'index.php';

Good Luck[/quote]

I have made what you said, I havecopied the above .htaccess code but my linck doesn't works. the browser shoe me the clasical message:

Not Found
The requested URL /login/logout was not found on this server.

#6

[eluser]josepichu[/eluser]
could be the problem some server settings??

phpinfo() says:

PHP Version 5.1.6

Apache Apache/2.2.3 (CentOS)
Version

MySQL support
Client API version 5.0.95

i have checked my error_log, It has a lot of errores like this:

[Tue Apr 10 05:59:34 2012] [error] [client 192.168.2.109] File does not exist: /var/www/html/guaguas/index, referer: http://192.168.2.127/guaguas/
[T/var/www/html/favicon.ico
#7

[eluser]selman555[/eluser]
Maybe a long shot, but I just solved the same problem you are having right now.

The only thing I did was change the RewriteBase to /
The base_url should always be ''




Theme © iAndrew 2016 - Forum software by © MyBB