简体   繁体   中英

Unable to redirect to other page in Codeigniter

I am working on Codeigniter before uploading the site. All of my controllers are working fine on my localhost, but after uploading the site to server when I try to access my sub-domain http://www.advertising.comlu.com/ it works. It means that the controller "school/index" works but when I try to click on other page it redirects to http://error404.000webhost.com/ ? so please help me.

Here is my .htaccess file:

DirectoryIndex index.php RewriteEngine on RewriteCond
%{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond $1 !^(index\.php|public|images|css|js|robots\.txt)

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

ErrorDocument 404 /error.php

Use this . htaccess which is I personally recommend for Codeigniter Users

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM