需要有关Codeigniter框架.htaccess规则的帮助


Need help on Codeigniter framework .htaccess rule

我正在编写一个由另一个开发人员开发的脚本。他没有在url中使用base_path(),当我在本地机器(examplep)上配置脚本时,我正在项目目录之外重定向。

Project directory /testing/
<link rel="stylesheet" href="/css/quick_register.css" />
<a href="/account/">Account</account>

online it works perfectly but when i click on this link local system it redirects me      
http://localhost/xampp
it should redirect me on http://localhost/testing/account
here is online .htaccess rule

#URL Re-writing
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www'.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?/$1

感谢

由于您的项目位于"测试"文件夹下,您需要根据项目位置更新rewritebase。尝试下面的htaccess文件:

#URL Re-writing
RewriteEngine On
RewriteBase /testing

尝试使用/不使用尾部斜线,它应该有效。