Welcome Guest, Not a member yet? Register   Sign In
Not Found The requested was not found on this server.
#1

[eluser]owenskie[/eluser]
Greetings!

I am new to codeigniter and have been developing web apps on a windows environment ever since. Recently, I had been tasked to deploy a project on a Red Hat linux box. After migrating the files and data, i get this error everytime I go beyond the home page.

Not Found
The requested URL *my url* was not found on this server.

i believe this is an issue of the url rewriting to do away with the index.php.
Here is the content of my current htaccess file:

Code:
RewriteEngine On

    RewriteRule /
    
    #If the file or directory exists, show it
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^(.+) - [PT,L]
    
    #Blank queries get sent to the index
    RewriteRule ^$ index.php [L]
    
    #All other queries get sent to the index as index.php/whatever
    RewriteRule ^(.*)$ index.php?$1 [L]
    
    RewriteCond $1 !^(index\.php|images|robots\.txt|js|css|user_guide)
    RewriteRule ^(.*)$ /index.php?$1 [L]

Am I doing things right? I tried all other solutions from the forum but none seemed to work.

Need help.
#2

[eluser]cideveloper[/eluser]
This has always worked for me on linux

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|user_guide|assets|robots\.txt)
RewriteRule ^(.*)$ /ci/index.php/$1 [L]
#3

[eluser]owenskie[/eluser]
Thanks cideveloper, but it still isnt working.
Additional info, if i try to remove the htaccess and have index.php, things work properly.
#4

[eluser]cideveloper[/eluser]
I forgot to take out the "ci" in the RewriteRule. That is a folder I have my stuff in. I dont know if you took that out cause if you didnt it would not work.

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|user_guide|assets|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
#5

[eluser]owenskie[/eluser]
Yes, I did take out the "/ci" still no go.
#6

[eluser]owenskie[/eluser]
Help, anyone? :-)
#7

[eluser]InsiteFX[/eluser]
This one works for me:
Code:
<IfModule mod_rewrite.c>

    <ifModule mod_php5.c>
        php_value default_charset utf-8
    </ifModule>

    Options +FollowSymLinks

    RewriteEngine On
    RewriteBase /

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

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

    RewriteCond $1 !^(index\.php|assets|css|js|scripts|icons|images|img|media|xml|user_guide|robots\.txt|favicon\.ico)
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]

    #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

    <IfModule mod_php5.c>
        RewriteRule ^(.*)$ index.php/$1 [L,QSA]
    </IfModule>

    <IfModule !mod_php5.c>
        RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
    </IfModule>

</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>

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB