I know there's so many topic about this, but I've tried and that isn't work.
my ci is located at htdocs/codeigniter3
I saw .htaccess inside of codeigniter3/application
folder, but I leave it alone. I create new .htaccess on root folder codeigniter3
(outside of application
)
my .htaccess is:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
also on config.php:
$config['base_url'] = 'http://localhost/codeigniter3/';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
on httpd.conf:
LoadModule rewrite_module modules/mod_rewrite.so
this mod_rewrite.so file also avaiable on apache/modules
Try this in your .htaccess file
RewriteEngine On
RewriteBase /YOUR_PROJECT_NAME
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Edit your .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
it work both local and live form me
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.