将web.config URL重写规则转换为.htaccess
我在将web.config URL重写规则转换为.htaccess,.htaccess,iis,mod-rewrite,url-rewriting,web-config,.htaccess,Iis,Mod Rewrite,Url Rewriting,Web Config,我在web.config中有以下IIS URL重写规则: 它们适用于任何子文件夹,如下所示: 案例A web.config和index.php存储在folder1/test: 请求/folder1/test/some/virtual/12url被发送到folder1/test/index.php 案例B web.config和index.php存储在folder2/where/this: 请求/folder2/where/this/virtual/12url被发送到folder2/where
web.config
中有以下IIS URL重写规则:
它们适用于任何子文件夹,如下所示:
案例A
web.config和index.php存储在folder1/test
:请求
/folder1/test/some/virtual/12url
被发送到folder1/test/index.php
案例B
web.config和index.php存储在folder2/where/this
:请求
/folder2/where/this/virtual/12url
被发送到folder2/where/this/index.php
对于切换到Apache,如何重写这些规则以便
无需在子文件夹URL更改时更新.htaccess?
(项目可能位于任何子文件夹中,不需要放置在文档根目录中。)尝试此操作
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d # not a dir
RewriteCond %{REQUEST_FILENAME} !-f # not a file
RewriteRule ^ index.php [L]
显示HTTP 500。日志:[core:alert][pid 3580:tid 884][client 127.0.0.1:56210]C:/thepath/.htaccess:RewriteCond:bad标志分隔符