我試過我在堆棧溢出這裏找到的每個解決方案,但沒有成功。Codeigniter刪除index.php - htaccess本地主機
我跑
-
上
- 贏8.1和
- 笨3.0.4
使用Smarty 3的最新版本
的config.php
$config['base_url'] = 'localhost';
$config['index_page'] = '';
routes.php文件
$route['default_controller'] = 'home';
$route['contact'] = 'contact';
的.htaccess
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
# !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
# slashes.
# If your page resides at
# http://www.example.com/mypage/test1
# then use
# RewriteBase /mypage/test1/
RewriteBase /responsive_template/
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
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.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
Apache的的LoadModuleř ewrite_module模塊/ mod_rewrite.so「啓用
<Directory />
AllowOverride all
Require all denied
</Directory>
如果我訪問localhost/responsive_template/index.php/contact
一切工作正常,只有localhost/responsive_template/contact
以404結束,僅此而已。
整個CodeIgniter的應用程序文件夾是在c:\xampp\htdocs
感謝所有幫助傢伙子目錄「responsive_template」,大加讚賞。
BR 大衛
工作就像一個魅力!非常感謝! :) – user3395711