how to install URL Rewrite Module using powershell?RSS

4 replies

Last post Jun 08, 2020 09:39 AM by Yuk Ding

  • how to install URL Rewrite Module using powershell?

    Jun 04, 2020 08:10 AM|iismonga|LINK

    Hi,

    I am new in iis. I have a question about how to install URL Rewrite Module using powershell?

    BACKGROUND: I have a website based on Vue, the router model is history, and I deploy it in iis. I can access this site, but when I refresh it will prompt 404, according to https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations I know I need to install  IIS UrlRewrite. It's all OK when I install it through graphical interface. However, now I need use docker windows container to run my site, I pull the offical image: mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019, I dont know how to install URL Rewrite Module(I can control the container by powershell). 

    I find this: https://hinchley.net/articles/configure-an-iis-rewrite-rule-using-powershell/. and I executed

    msiexec.exe /i rewrite_amd64.msi /qb

    then I copy web.config mentioned in vue router to  the root directory of my site, refresh it will prompt 500 - Internal server error.

    I've been confused for days. I am so appreciate if anyone could help me。

  • Re: how to install URL Rewrite Module using powershell?

    Jun 04, 2020 01:15 PM|lextm|LINK

    iismonga

    it will prompt 500 - Internal server error.

    The actual 500 error page should contain everything you need. Sometimes you need to get the detailed error page by running a browser on the server itself. For Server Core, you can use Invoke-WebRequest cmdlets to achieve the same.

    Lex Li
    Affordable IIS Consulting Services at https://support.lextudio.com/services/consulting.html
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: how to install URL Rewrite Module using powershell?

    Jun 05, 2020 01:30 AM|iismonga|LINK

    There is no more useful information, it just: There is a problem with the resource you are looking for, and it cannot be displayed. Its the same with Invoke-WebRequest cmdlets.

    The problem is url rewrite module. I think I dont install it properly.

  • Re: how to install URL Rewrite Module using powershell?

    Jun 05, 2020 05:05 AM|iismonga|LINK

    OK, I know what the problem. There are some format error in web.config when I generate it by echo command.

    So this is the steps:

    1 downloading URL Rewrite Module 2.1 from https://www.iis.net/downloads/microsoft/url-rewrite(bottom of the site to get msi file)  

    2 coping rewrite_amd64_en-US.msi to docker container

    3 opening the directory of rewrite_amd64_en-US.msi, then:

    msiexec.exe /i rewrite_amd64_en-US.msi /L*v installLog.log

    4 through gwmi Win32_Product we can see IIS URL Rewrite Module 2 has been installed

    5 creating the web.config file acording to  https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations and coping to C:\inetpub\wwwroot

  • Re: how to install URL Rewrite Module using powershell?

    Jun 08, 2020 09:39 AM|Yuk Ding|LINK

    Hi iismonga,

    I'm so glad that your problem has been fixed.It is appreciated if you could mark your solution as answer.

    Best Regards,

    Jokies Ding

    Yuk Ding

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.