We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36667
    • 57 Posts
    Peter Falkenberg Brown Reply #1, 14 years, 3 months ago
    Hello All,

    (See bottom of post for solution. It was not a MODx problem.)

    I’m using Evolution 1.0.2 and have a weird problem with friendly urls and the rewrite rule to exclude directories. I don’t know if it’s MODx or something buried in Apache (running on Linux, in a shared environment).

    I installed a web calendar application outside of MODx, in /calendar.
    I added the directory to the exclude string in .htaccess:

    RewriteRule ^(manager|assets|calendar) - [L]

    because I’m using Friendly URLS.

    With and without the above .htaccess modification, when I pull up the various .php files in the /calendar directory, I’m able to correctly access some of them, but not others.

    For example, I can correctly access /calendar/login.php and some others.
    But when I go to /calendar/month.php and some other files, I get directed to the MODx error page, which leads me to believe that some of the files are being ignored by the rewrite rule, but not others.

    I’ve verified that the files work; e.g. ’month.php’ works fine from the shell prompt.

    I tried adding the .htaccess file that was in /manager/ to the /calendar/ folder, that turns off rewriting, to no avail.

    I also noticed that when I commented out the ’manager’ directory from the string above, in .htaccess, /manager/ still worked (and the htacess file in /manager/ that turns rewrite off is disabled). Thus, I’m very puzzled as to how MODx is controlling the rewrite exceptions, and am wondering if the process is being done in the MODx scripts or data tables.

    The biggest puzzler is that some, but not all, of the /calendar/ files are working correctly. It made me wonder if some of the files, like ’month.php’ were being included in the rewrite rule because the word ’month’ was reserved in MODx. But that didn’t make a lot of sense to me.

    I’ve searched through the MODx forums, and the Apache mod_rewrite forums to no avail. So, after 3 hours of banging my head against the wall, I’m hoping that some MODx genius can help smiley.

    I’ve also put in a ticket with the hosting company, with the thought that something in their Apache config might be responsible. But that still doesn’t explain how /manager/ is getting excluded correctly.

    Thanks!

    Peter Brown
      Visit The Significato Journal ~ nectar for the soul ~ http://significatojournal.com
      • 36667
      • 57 Posts
      Peter Falkenberg Brown Reply #2, 14 years, 3 months ago
      Hello Again,

      I’m stumped on this one - but I know the answer exists somewhere.
      My hosting company thinks it’s application related.

      I wondered if there was a conflict with certain file names, but only
      found two files - month.php and year.php - that were duplicated (in Doc Finder).
      But they were in different directories, and when I disabled Doc Finder, the
      calendar still didn’t work.

      These are the files in the calendar program that don’t work:

      - /calendar/month.php:
      - /calendar/day.php:
      - /calendar/week_details.php:
      - /calendar/week.php:
      - /calendar/year.php:

      It’s very odd. It may be the calendar program, and I’m checking with that vendor.

      The very, very odd thing that I can’t figure out is why the month.php file is getting redirected to the MODx error page. There seems to be an interaction going on with MODx that seems relevant; either the rewrite rule or something else in MODx.

      Looking for clues....

      Thanks,

      Peter


        Visit The Significato Journal ~ nectar for the soul ~ http://significatojournal.com
        • 5340
        • 1,624 Posts
        Another longshot for today:
        try renaming month to month2 an test smiley

        I remember one day I had a problem with a file name but it was not related to modx. Maybe the server.

        Also try to copy the .htaccess file from manager to your calendar folder. That file tells not to use friendly urls on the folder.
          • 36667
          • 57 Posts
          Peter Falkenberg Brown Reply #4, 14 years, 3 months ago
          Well...

          This is my second experience of being impressed with MODx, after thinking I had run into something with MODx that might have been a MODx issue. Three cheers for MODx!

          *Because* I had run the month.php file from the shell prompt and it worked, I assumed that there was no problem with the script. The fact that the file gave a Not Found response from a web browser made me think that it was not an application problem.

          Well... one learns something every day. My wife prayed to the Angels of Programming (really!) after I had spent 5 hours messing with this problem, and I then Googled the problem again, focused on the application itself. (By the way, I renamed the file ’month2.php’ and that file worked, which convinced me that the file was not broken.)

          But it was. The sourceforge forum for WebCalendar has a post stating that php 5.2.8 broke a subroutine in the calendar program, specifically requiring the string "+ 1900" to be added to the statement below:

          $midnight = gmmktime ( - ( date ( ’Z’, $item->getDateTimeTS () ) / 3600
          ),0, 0, $lt[4] + 1, $lt[3] + 1, $lt[5] + 1900 );

          Once I added that string, everything worked.

          Sigh. Oy. Oy again. I feel chagrined because this is my second post looking for a MODx bug fix when it wasn’t MODx at all.

          So, many kudos to the brilliant MODx developers and community smiley.

          Best regards,

          Peter
            Visit The Significato Journal ~ nectar for the soul ~ http://significatojournal.com