如何在服务器 windows 的 plesk17 上安装 Apache

How to install Apache on plesk17 in server windows

我有 Windows 服务器并在上面安装了 plesk17。我有自定义 CMS 并且使用了 .httpaccess .

但是我的网络服务器是iis而不是运行 .httpaccess;我无法将服务器更改为 Linux...

plesk17 上是否安装了 Apache Windows?

我的主要问题是没有运行以下代码:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /cms/index.php?/ [L]�

如果我能指导你解决我的问题,我将不胜感激

我可以帮助您将 .htaccess 文件转换为 URLRewrite 规则。请注意 URL Rewrite 不是默认 IIS 安装的一部分,必须下载。此处可用:https://www.iis.net/downloads/microsoft/url-rewrite

接下来为默认网站创建 URL 重写规则的命令如下:


Add-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST/Default Web Site'  -filter "system.webServer/rewrite/rules" -name "." -value @{name='ConvertedRule';stopProcessing='True'}
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST/Default Web Site'  -filter "system.webServer/rewrite/rules/rule[@name='ConvertedRule']/match" -name "url" -value "^(.*)$"
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST/Default Web Site'  -filter "system.webServer/rewrite/rules/rule[@name='ConvertedRule']/match" -name "ignoreCase" -value "False"

Add-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST/Default Web Site'  -filter "system.webServer/rewrite/rules/rule[@name='ConvertedRule']/conditions" -name "." -value @{input='{REQUEST_FILENAME}';matchType='IsFile';negate='True'}

Add-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST/Default Web Site'  -filter "system.webServer/rewrite/rules/rule[@name='ConvertedRule']/conditions" -name "." -value @{input='{REQUEST_FILENAME}';matchType='IsDirectory';negate='True'}
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST/Default Web Site'  -filter "system.webServer/rewrite/rules/rule[@name='ConvertedRule']/action" -name "type" -value "Rewrite"
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST/Default Web Site'  -filter "system.webServer/rewrite/rules/rule[@name='ConvertedRule']/action" -name "url" -value "/cms/index.php?/{R:1}"
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST/Default Web Site'  -filter "system.webServer/rewrite/rules/rule[@name='ConvertedRule']/action" -name "appendQueryString" -value "False"

并将生成如下所示的配置:

<rule name="ConvertedRule" stopProcessing="true">
   <match url="^(.*)$" ignoreCase="false" />
   <conditions>
      <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
      <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
   </conditions>
   <action type="Rewrite" url="/cms/index.php?/{R:1}" appendQueryString="false" />
</rule>