当我将.htaccess文件代码粘贴到我的本地机器上时,它工作得很好,就像我的url没有index.php的情况一样,但是当我将相同的代码上传到linux服务器时,url再次需要index.php,有人可以指导我如何在linux服务器上删除index.php .
这是我的.htacces代码
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 这是我的.htaccess代码,我在本地windows机器上很好地解释了这一工作,但是当我将相同的代码上传到linux服务器时,我的循环引擎就不能工作了。
发布于 2015-11-17 14:26:55
发布于 2015-11-17 12:18:07
将此代码添加到htaccess文件中。
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteCond $1 !^(index\.php|images|js|uploads|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]希望这个代码有帮助!
发布于 2015-11-17 12:29:53
我建议将.htaccess设置在与应用程序文件夹相同的级别,并将以下代码放入其中。
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]https://stackoverflow.com/questions/33756464
复制相似问题