我有这个网站在CodeIgniter上运行,我已经安装Traq问题跟踪。 在public_html我有我的应用程序和系统目录以及一个资产目录,以及traq。 即:
public_html ├── application ├── assets ├── system └── traq
当我访问http://mywebpage.com/traq时,我的页面正常工作,以及traq的第一个login屏幕。 当我访问traq中的任何其他页面,它不工作,它redirect到codeigniter,并给我404。例如,当我login它试图去http://mywebpage.com/traq/login和404失败。
这是我的.htaccess文件。 有人可以修复它,或至less指出我在正确的方向吗?
<IfModule mod_rewrite.c> RewriteEngine On #RewriteBase / RewriteCond %{REQUEST_URI} ^ci_app.* RewriteRule ^(.*)$ index.php?/$1 [L] RewriteCond %{REQUEST_URI} ^traq.* RewriteRule ^traq(.*)$ traq/index.php/$1 [L] RewriteCond $1 !^(index\.php|humans\.txt|robots\.txt|assets|traq) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule> <IfModule !mod_rewrite.c> ErrorDocument 404 /index.php </IfModule>
RewriteCond %{REQUEST_URI} ^traq.* RewriteRule ^traq(.*)$ traq/index.php/$1 [L]
请求条件应包含一个绝对位置,因为您正在使用“起始行”锚点(^)! ^ traq不会匹配/ traq,^ / traq会。 解决这个问题,无论你使用^锚,你是金。