We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22629
    • 194 Posts
    I have a brand-new 2.2.6 site up and running on Windows 2012, IIS 8, PHP 5.4.9. The site and manager is working great, but as soon as I switch on friendly URLs, all links are generated blank.

    I've looked into it, and the makeUrl method in modContext seems to be failing because $this->aliasMaps is empty.

    It seems to be the exact same problem reported by BobRay 3 years ago, here, yet this is not an upgrade, it's a clean install of 2.2.6.

    If I turn off FURLs, everything works fine.

    In my context.cache.php file, aliasMaps is empty, as is resourceMaps, and no amount of clearing the cache, or removing all cache files manually changes this.

    Any ideas?

    Thanks,
    Andy
      Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

      modx Revolution 2.2.6
      Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

      Content-Managed Websites Built on MODX
      • 3186 ☆ A M B ☆
      • 279 Posts
      I think Windows is the problem.. I never use Windows for my websites, even in development I have a linux machine. For as far I know, .htaccess will not work in Windows, so rewriting URLs will not work either.. Maybe it works, but then in anohter way I guess
        MODX Ambassador (NL) & Professional MODX developer
        Follow me on Twitter | Visit my page on Facebook | View my code on Github | View my script posts
        MODX e-commerce solution SimpleCart
        • 3749
        • 24,544 Posts
        I'm definitely not going to defend Windows in general, but XAMPP runs fine under Windows and provides an Apache server that uses .htaccess just like a real server. wink

        IIS, is another story, though. See these:

        https://forums.modx.com/thread/?thread=17127


        http://stackoverflow.com/questions/257936/htaccess-or-htpasswd-equivalent-on-iis
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 22629
          • 194 Posts
          Guys,

          Thanks for the replies, but the issue is not with .htaccess or the rewrites. I can access content perfectly fine using site.com/1.html, as I have configured the IIS Rewrite Module with the same rules as in .htaccess.

          My issue is that when I turn friendly URLs on, the URLs that modx generates are empty - exactly the same issue you had, BobRay, in the thread I referenced in my original post, but that was supposed to have been fixed years ago.

          Unfortunately I have no choice over the infrastructure - this company is a Microsoft shop, we just cannot find a .NET CMS within the budget for this project, so I've suggested MODx. The only caveat is that it has to run under IIS with SQL Server.
            Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

            modx Revolution 2.2.6
            Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

            Content-Managed Websites Built on MODX
            • 3186 ☆ A M B ☆
            • 279 Posts
            Is the cache directory writable at all?? Otherwise I don't know what could be the issue :$
              MODX Ambassador (NL) & Professional MODX developer
              Follow me on Twitter | Visit my page on Facebook | View my code on Github | View my script posts
              MODX e-commerce solution SimpleCart
              • 39333
              • 151 Posts
              Did you check the alias on your resources? Do you have auto generate alias to Yes in sys settings? Is this happening on all resources or just container elements?

              Check those things.
                MODX...the Zen of CMS
                "Bight off more than you can chew and keep right on chewing."
                • 22629
                • 194 Posts
                bertoost - Yes the cache directory is writeable, and cache files (such as the context.cache.php) are being written there.

                Eric SWD - yes there are aliases on resources as I always specify them myself. If there weren't, modx would still give an alias of the resource's ID (e.g. /4) It's happening on every resource.

                Strange this is, I have another modx site on a similar environment - Windows Server 2012, IIS 8.0, PHP 5.4, MySQL 5.5.29 - and I've just switched FURLs on that site on and it works fine, so it must be something specific on this site.

                Are there any other files/directories other than the cache folder that need to be writeable for the alias maps to be generated?
                  Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

                  modx Revolution 2.2.6
                  Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

                  Content-Managed Websites Built on MODX
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  My issue is that when I turn friendly URLs on, the URLs that modx generates are empty
                  Does this apply to Wayfinder and getResources URLs, MODx tag-generated urls and snippets that use the makeURL() function?
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 22629
                    • 194 Posts
                    Quote from: sottwell at Mar 10, 2013, 04:25 AM
                    Does this apply to Wayfinder and getResources URLs, MODx tag-generated urls and snippets that use the makeURL() function?

                    Susan, any URLs that modx generates - page links using [[~1]], links in getResources templates (which I use [[~[[+id]]]] syntax), and I also knocked up a quick snippet that did $modx->makeURL(1) and that came back as empty as well.

                    When I turn FURLs off, all the above work correctly albeit with "index.php?q=1" URLs.

                    As I now know (as of this morning) that this is not platform-specific (i.e. another modx site hosted on a similar Windows platform works fine with FURL on) I'm guessing it's something on my other environment - perhaps permissions, but this environment is quite restrictive so I need to know where else write access may be needed.
                      Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

                      modx Revolution 2.2.6
                      Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

                      Content-Managed Websites Built on MODX
                      • 22629
                      • 194 Posts
                      I'm still battling with this issue. The only difference I have realised between the site I'm working with now, and the Windows 2012 environment (where FURLs work) is that this site has a SQL Server backend, while the working site has MySQL.

                      Is there anyone in the community that understands this area of MODX well that would be willing to work with me to help resolve this issue?
                      Can anyone else test this with SQL Server and Windows to see if the SQL Server driver is the likely cause?
                        Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

                        modx Revolution 2.2.6
                        Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

                        Content-Managed Websites Built on MODX