【发布时间】:2012-03-27 09:28:44
【问题描述】:
我的 .htaccess 中有这段代码:
DirectoryIndex index.php -->
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
它在我的本地主机 (MAMP) 和在线使用 MediaTemple 之类的主机运行良好,但使用 WAMP 和其他主机如 1and1 它不起作用!
您有什么想法可以调整它以便在任何地方工作吗?
谢谢!
【问题讨论】:
-
我发现在某些情况下 htaccess 可以在某处工作但在其他地方无法使用,这有助于添加
RewriteBase,值得一试
标签: .htaccess codeigniter syntax hosting localhost