0

I have the latest version of EE installed on a Windows 2012 Server with the URL Rewrite module installed. I'm migrating over to this server from an older apache installation that used Mod Rewrite successfully.

EE is installed in a subdirectory one level down from root (ee) and each dept's index.php file is in another directory (dept1, dept2, etc).

E:/data/web1/ee
E:/data/web1/dept1
E:/data/web1/dept2

We have a bunch of extra EE 'sites' added for various internal departments so I need the rewrite to handle those as well.

<rule name="EE rewrite" stopProcessing="true">
    <match url="^/(dept1|dept2|dept3|dept4|dept5)/(.*)$" ignoreCase="true" />
    <conditions logicalGrouping="MatchAny">
        <add input="{R:1}" pattern="^(index\\.php|images|css|js|favicon\\.ico)" ignoreCase="false" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
    </conditions>
    <action type="Rewrite" url="/{R:1}/index.php/{R:1}/{R:2}" />
</rule>

I've tried importing the apache conf file and that didn't work so I've been bashing my head over this for a while.

With this current iteration above it loads the admin control panel and loads dept home pages ok but fails to load department subpages and links. They return 404.

this works: http://test.example.edu/dept2/
this fails: http://test.example.edu/dept2/blah/stuff

What am I missing?

After resolving the main issue, what can be improved upon?
Might it be an EE config or IIS config?

2 Answers 2

0

I stay 70 million miles away from IIS, but some general research tells me:

http://www.helicontech.com/isapi_rewrite

purchasing that module for IIS will give your best shot at handling EE with IIS. Also:

http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/expressionengine-on-iis

Not sure why you'd want to run PHP on a less powerful agent (I assume not your choice) and very clearly less supported openly (I can whip up anything you want in .htaccess like magic, but XML? Lolwut?). I know this isn't the most helpful answer, but I don't know how many IIS ringers you are going to find here. To be honest, you'd probably be better off asking this on StackOverflow.

1
  • I appreciate your feedback and thanks for the links. Regards of whether I use IIS's URL Rewrite or ISAPI Rewrite, I can't get EE to show subpages correctly. It either returns the same page as the main page or a 404 error. Commented Sep 2, 2015 at 20:37
0

These are the steps I took to get it to work.

  1. edit EE system config.php:

    $config[‘uri_protocol’] = ‘QUERY_STRING’;

  2. Expression Engine control panel:
    Force URL query strings = Off

  3. rewrites:

rule 1:

^(dept1|dept2|dept3)/?(.*)$
{R:1}/index.php?/{R:1}/{R:2}

rule 2:

^(.*)$<br/>
ABC/index.php?/{R:1}

I also added 'ignore if file' and 'ignore if folder' so the site would display correctly and so I could get into the EE admin control panel.

The entire block of rules is viewable here where I posted the same question on the Ellis Labs site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.