known icon indicating copy to clipboard operation
known copied to clipboard

Web.config file So That Known Works On Internet Information Services

Open Cambridgeport90 opened this issue 4 years ago • 6 comments

Is your feature request related to a problem? Please describe.

Most PHP applications nowadays; Wordpress, YOURLS, and others, have web.config files in order for them to work on both IIS on Windows, as well as the rest of the web servers which use .htaccess, which requires a special module for IIS to support.

Describe the solution you'd like

The objective here is to have support for all web servers, all platforms equally. (I am more of a Windows person, myself.) Two methods are possible, and I intend to test both. First is to use the URL Rewrite module in IIS to translate the .htaccess syntax into the equivalent XML (happens sort of automatically, though I have never had to do it so far), or there is a third party module that can allow IIS to support .htaccess natively, but it's a paid option if you want more than I think three sites. .

Describe alternatives you've considered

None that I can think of at the moment.

Additional context

I will update when and if I discover this can work, though I think it can.

Cambridgeport90 avatar Feb 02 '21 23:02 Cambridgeport90

I'm really supportive of this as an endeavor, although I don't have a Windows box I can test this on myself.

benwerd avatar Feb 07 '21 23:02 benwerd

No worries. I will have one set up very soon. It's been a rush since my group had a huge migration of server hardware from FL to MA that we're still recovering from.

Cambridgeport90 avatar Feb 13 '21 19:02 Cambridgeport90

As I promised an update... it appears that while I haven't figured out the web.config part of it just yet (trying to automatically translate using URL_Rewrite doesn't seem to catch all the directives, so I will figure those out manually when I have time), I did figure out that installing the Helicon Ape module does indeed allow the content to load just fine on IIS. If you remember, that module basically turns some of the more common Apache modules into formats that make them available to IIS.

Cambridgeport90 avatar Jul 05 '21 23:07 Cambridgeport90

@Cambridgeport90 have you tried this for routing through index.php

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
          <rule name="Known" stopProcessing="true">
            <match url="^(.*)$" ignoreCase="false" />
              <conditions logicalGrouping="MatchAll">
                <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                <add input="{R:1}" pattern="^(index\.php)" ignoreCase="false" negate="true" />
              </conditions>
            <action type="Rewrite" url="/index.php/{R:1}" />
          </rule>
        </rewrite>
    </system.webServer>
</configuration>

ipranjal avatar Dec 11 '21 21:12 ipranjal

I haven't had a lot of time to work on this for a while, though I definitely intend to do so now that I did manage to get things working on my laptop. Surprisingly. I was using it as a development machine, but I'll have to check out what you just sent me. If not, then I'll let you know. If it does work, then we can make it an official poll request.

Cambridgeport90 avatar Dec 11 '21 21:12 Cambridgeport90

known uses ToroPHP for routing https://github.com/anandkunal/ToroPHP/ , its readme contains description for all apache,IIS and NginX config @benwerd this can probably be closed

ipranjal avatar Dec 12 '21 09:12 ipranjal