我想知道是否有可能检查是否mod_rewrite在Apache和IIS上启用了PHP.
存在用于IIS的ModRewrite.检查一下here.
所以,我正在寻找一个mod_rewrite在Apache和IIS上检查的PHP脚本.
有谁知道这样的脚本或可以写一个?
特别是对于Microsoft IIS.
谢谢!
目前我正在使用lightspeed服务器托管.托管说mod_rewrite已启用但我无法让我的脚本在那里工作.每当我尝试访问该URL时,它都会返回404 - 未找到的页面.
我将相同的代码放在另一台运行Apache的服务器上.它正在那里工作.所以我想,这是.htaccess和mod_rewrite问题.
但Hosting支持仍然坚持要求他们的mod_rewrite已启用,所以我想知道如何检查它是否实际启用.
我试着检查phpinfo(),但没有运气,我找不到mod_rewrite,是因为他们正在使用lightspeed?
有没有办法检查?请帮帮我.谢谢.
仅供参考:我的.htaccess代码是
Options -Indexes
<IfModule mod_rewrite.c>
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
</IfModule>
Run Code Online (Sandbox Code Playgroud)
我也尝试过这样
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
Run Code Online (Sandbox Code Playgroud)
但结果相同.
我一直在XAMPP中使用CodeIgniter.重定向到功能URL没有问题(例如,function1):
http://localhost/function1
Run Code Online (Sandbox Code Playgroud)
当我改为WAMP时,我遇到了问题.我无法重定向到function1.但是,仍然可以在以下位置访问function1:
http://localhost/index.php/function1
Run Code Online (Sandbox Code Playgroud)
如何配置WAMP和CodeIgniter来删除index.php?为了在运行XAMPP时可以运行function1.
谢谢.