Codeigniter “The requested URL was not found” erro

2019-02-12 03:45发布

问题:

I downloaded project the my server then I changed config file and database as usually and finally i deleted the htaccess file that is in the main folder. Now i can go to my home page but i can't go to other links in my site and i got this error.

**Not Found
    The requested URL /utripes/auther/signup signup was not found on this server.**

How can i fix this error. please need quick help. than you.

回答1:

As you delete the htaccess file from your project root directory so your url should include index.php.

I recommend that you include the htaccess file in your project root directory and paste the following code into the htaccess file..

RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1

I think now your project should work fine..



回答2:

your rewrite rule should be like this

RewriteRule ^(.*)$ /new/index.php?/$1 [L,QSA]