Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在windows plesk server中重写htaccess规则_Php_Asp.net_.htaccess - Fatal编程技术网

Php 如何在windows plesk server中重写htaccess规则

Php 如何在windows plesk server中重写htaccess规则,php,asp.net,.htaccess,Php,Asp.net,.htaccess,我有一个用php制作的网站,我把它放在linux共享主机中。现在出于某种目的,我把这个网站上传到了windows专用服务器上。除了我编写的htaccess规则不起作用之外,其他一切都正常,我收到了404错误(服务器中找不到请求的路径)。我发现一些文章知道我必须将htaccess转换为web.config文件。我在文件夹中使用的htaccess,我不知道应该将web.config文件放在哪里 RewriteRule ^([a-zA-Z0-9-]*)?$ index.php?PG=

我有一个用php制作的网站,我把它放在linux共享主机中。现在出于某种目的,我把这个网站上传到了windows专用服务器上。除了我编写的htaccess规则不起作用之外,其他一切都正常,我收到了404错误(服务器中找不到请求的路径)。我发现一些文章知道我必须将htaccess转换为web.config文件。我在文件夹中使用的htaccess,我不知道应该将web.config文件放在哪里

RewriteRule    ^([a-zA-Z0-9-]*)?$       index.php?PG=$1

此规则位于文件夹中。

您可以使用以下代码进行尝试:

<rewrite>
    <rule name="rule 1A">
        <match url="^([a-zA-Z0-9-]*)?$" />
        <action type="Rewrite" url="/index.php?PG={R:1}" />
    </rule>
</rewrite>


并保存在web.config

中,如果我有两个参数,则可能重复该参数,然后如何执行。