从Wamp中的Codeigniter URL中删除index.php
我在尝试从网址的网址中删除index.php时遇到了大问题。
I have big problem trying to remove index.php from url's
我在论坛上搜索了很多(这也是),但对我的情况没有帮助。
i have searched lots if forums (this also), but no help for my situation.
所以我有config.php文件
so i have config.php file
$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
位于index.php附近的public_html文件夹中的.htaccess文件。
my .htaccess file in public_html folder near index.php.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
我的rewrite_module已打开(并且正在运行)和我的httpd。 conf AllowOverride设置为All
i have rewrite_module ON (and it's working) and my httpd.conf AllowOverride set to All
所以当我转到mydomain.com/controller/action时-我得到404
但当我转到mydomain.com/ index.php / controller / action-一切正常。.
so when i am going to mydomain.com/controller/action - I get 404 but when i go to mydomain.com/index.php/controller/action - everything is OK..
我尝试了很多.htaccess示例...等等。 p>
i have tried lots of .htaccess examples... and so on.. nothing helps..
.htaccess
(应放置在应用程序文件夹之外)
.htaccess
(This should be place outside application folder)
粘贴此
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
注意:有时
index.php
不会在Windows中删除。但是,如果将其上传到服务器,它将可以正常工作。在XAMPP
中也会发生这种情况,但是如果我将其上传到主机(Linux),它也可以正常工作
Note : Sometime
index.php
will not remove in windows. But if you upload it to server it will work fine. This happen me too inXAMPP
but if i upload it to host(Linux) it works fine