ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

physical folder with same name as template

October 17, 2014 12:20pm

Subscribe [2]
  • #1 / Oct 17, 2014 12:20pm

    lelkins001

    9 posts

    I’ve built a french section of my website using a template group called /fr.  Works great.  However now I am getting a request to upload a web-help section that is created by a different program and have it under the url /fr/docs. 

    The problem is if I create a physical folder for /fr to then place the docs, then that physical file structure seems to take precedence over EE and I get a 403 error. 

    Maybe do something with rewrite rules?

    Please help!

  • #2 / Oct 17, 2014 7:04pm

    USC Chan

    81 posts

    The problem is if I create a physical folder for /fr to then place the docs, then that physical file structure seems to take precedence over EE and I get a 403 error. 

    Maybe do something with rewrite rules?

    Are you doing anything with .htaccess to hide index.php from your URLs?

    If you’re not, you should be able to call EE with domain.com/index.php/fr/whatever, and your physical docs with domain.com/fr/whatever. The second URL shouldn’t know anything about EE.

    If you’re using .htaccess to hide index.php, it’s trickier. If, for example, you have domain.com/fr/whatever rewriting as domain.com/index.php/fr/whatever, that’s always going to hit EE and there won’t be any way to refer to your docs directory.

    Not sure if this helps.

  • #3 / Oct 21, 2014 12:14pm

    lelkins001

    9 posts

    Yes index.php is being hidden.  This is also on a windows server running IIS.  Looks like I found a solution.

    In the web.config file, removing the matchType=“IsDirectory” condition from my rewrite rule allows me to create physical folders with the same directory name as pages being served from EE.

    <rule name="EERewrite" stopProcessing="true">
      <match url="^(.*)$" ignoreCase="false" >
      <conditions>
        <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" >
    
        <!--  Take out to allow physical directories exist when CMS is using the same directory name 
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" >
         -->
    
      </conditions>
    
    
    -- update --  I thought this worked, but any physical folder with an index.htm file in it bombed and gave a 404.
      <action type="Rewrite" url="./index.php/{R:1}" appendQueryString="true" >
    </rule>
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases