我下载了基于代码触发器的MyClientBase应用程序。安装后,我查看了MyClientBase的网站,但默认情况下index.php仍然在那里。我尝试使用codeigniter用户指南中的提示删除index.php,但不起作用。这个问题有什么解决方案吗?谢谢
发布于 2011-08-14 22:57:53
我使用以下.htaccess文件删除index.php。我不确定用户指南中指定了哪一个,但我发现它工作得很好:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and the robots.txt file
RewriteCond $1 !^(index\.php|(.*)\.swf|images|robots\.txt|css|docs|cache)
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>还要从config.php文件中删除'index.php‘。祝好运!
发布于 2016-08-09 15:18:50
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]https://stackoverflow.com/questions/7057508
复制相似问题