我有這個.htaccess
文件,我使用Codeigniter 2.2.0,並且在我的控制器中使用子目錄時效果很好。但在笨3.0我無法通過鏈接http://localhost/myprojectCodeIgniter 3.0 .htaccess不能正常工作
Althought訪問我的網站,以下環節的工作:
http://localhost/myproject/index.php/frontend/home
http://localhost/myproject/frontend/home
我的路線是明確界定
$route['default_controller'] = 'frontend/home/index';
And my .htaccess
Options -Indexes
Options +FollowSymLinks
# Set the default file for indexes
DirectoryIndex index.php
<IfModule mod_rewrite.c>
# activate URL rewriting
RewriteEngine on
# do not rewrite links to the documentation, assets and public files
RewriteCond $1 !^(index\.php|public|robots\.txt)
# do not rewrite for php files in the document root, robots.txt or the maintenance page
RewriteCond $1 !^([^\..]+\.php|robots\.txt|sitemap\.xml)
# but rewrite everything else
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.
ErrorDocument 404 index.php
</IfModule>