We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32963
    • 1,732 Posts
    Hi Everyone,

    Check out this article on how you can enable Friendly URL Addressing using IIS 5’s Custom Error URLs:

    http://www.developersdex.com/gurus/articles/702.asp?Page=1

    Now is this cool or what?

      xWisdom
      www.xwisdomhtml.com
      The fear of the Lord is the beginning of wisdom:
      MODx Co-Founder - Create and do more with less.
    • I try to avoid Windows servers... wink

      But that is really cool indeed! An awesome solution that hopefully we’ll get in a future preview release... is it doable, Raymond?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 32963
        • 1,732 Posts
        Quote from: rthrash at Jul 28, 2005, 08:17 PM

        I try to avoid Windows servers... wink

        But that is really cool indeed! An awesome solution that hopefully we’ll get in a future preview release... is it doable, Raymond?

        Well, it might be possible. I’m will be doing some research on it but if anyone else can help out here then that would be great!
          xWisdom
          www.xwisdomhtml.com
          The fear of the Lord is the beginning of wisdom:
          MODx Co-Founder - Create and do more with less.
          • 4018
          • 1,131 Posts
          Quote from: rthrash at Jul 28, 2005, 08:17 PM

          I try to avoid Windows servers... wink

          But that is really cool indeed! An awesome solution that hopefully we’ll get in a future preview release... is it doable, Raymond?

          Being an ex-ASP developer...I know what you mean! In regards to getting this sort of thing in a future preview release...I won’t worry about it! This is something that’s more useful to someone using ASP/ASP.NET and running their own IIS server. Granted, very doable with PHP when it comes to picking up an error code and what not. In fact, you don’t even have to really do anything with MODx to get it to do this. With a cleverly written snippet, it’s very possible to create this sort of functionality. In fact, a module could be written to handle the different error codes and a snippet to output them via a cleverly designed error page. Why make it something as part of the core when it can be a module and/or snippet instead? But remember...unless you’re running your own IIS server or have a hosting provider that allows you to assign your own redirects for errors in IIS, this is basically useless.

          Actually, one of the things that could go in the core code is error handlers themselves. What would be really nice is to have access to the error message itself from within MODx. This way, not only can you have MODx redirect the visitor to a custom error page, but you can also output a specific error message letting the visitor know exactly what happened. An error page could be extended further to allow the visitor the ability to send you an e-mail detailing the error right from the error page...very handy indeed! But the key is to have some sort of way of assigning the error code and error details into variables that can easily be picked up by a custom error page. Might wanna give this some thought. Granted, this sort of thing won’t help you if the parser just completely bugs out on you and won’t even display the error page itself...but for those times when a snippet or the like is hosed, this would be handy indeed! laugh
            Jeff Whitfield

            "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
            • 32963
            • 1,732 Posts
            It’s really not a big problem. We only need IIS servers to support friendly urls. This is not a burden to the core. As is now Apache sends redirects to a page using ?q=url. We can simply code the system listen to 404 calls sent from an IIS server.

            Al lot of ISP out there allow users to modify or setup custom error pages.

            If we can get this to work well without creating any overheads then that would be a plus for the system. This would mean that users of IIS or Apache can make the best use of the system. Beside it might event help to convert some of those ASP guys over to php
              xWisdom
              www.xwisdomhtml.com
              The fear of the Lord is the beginning of wisdom:
              MODx Co-Founder - Create and do more with less.
              • 32963
              • 1,732 Posts

              Ok guys here you go:

              Edit the index.php file inside the root of your modx website and paste the following code at line 99:

              // Quick IIS friendly url fix - note: this is a quick fix!
              $url = $_SERVER[’QUERY_STRING’];
              list($err,$url) = explode(";",$url);
              if($err==’404’ && !$url) $_GET[’q’]=$url;

              This should do the trick for friendly urls using IIS. Next you need to change your custom 404 URL to point to the index.php file. That’s it!

              Now point your browser to your new website. For example, http://www.mymodx.com/home.html

              More into on setting up IIS with custom error page redirects

              1) Open IIS Manage In MMC.
              2) Right Click on the web site node and choose properties.
              3) Click on the Custom Errors Tab.
              4) Scroll down until you see the HTTP Error -- 404.
              5) Double click on 404 to open the "Error Mapping Properties" dialog.
              6) Change the Message Type to URL.
              7) For the URL enter in /index.php
              8) Click OK and Then OK again

                xWisdom
                www.xwisdomhtml.com
                The fear of the Lord is the beginning of wisdom:
                MODx Co-Founder - Create and do more with less.
                • 32963
                • 1,732 Posts

                Wow! It works like a charm!

                I just logged into my HSPhere control panel, setup my 404 page to redirect to /index.php and bingo! I’m done smiley

                :’( I never ever thought that my IIS server would ever be able to enjoy the nice looking urls smiley
                  xWisdom
                  www.xwisdomhtml.com
                  The fear of the Lord is the beginning of wisdom:
                  MODx Co-Founder - Create and do more with less.
                • Awesome stuff Raymond... Cool!

                  Now all we need is a conditional based on the server type, which will be set during install of course. wink
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • Will this work with IIS 6? Or only 5?
                      • 32963
                      • 1,732 Posts
                      Quote from: OpenGeek at Jul 29, 2005, 07:16 PM

                      Will this work with IIS 6?? Or only 5?

                      Sure will. This solutiuon will work in IIS 5 or higher
                        xWisdom
                        www.xwisdomhtml.com
                        The fear of the Lord is the beginning of wisdom:
                        MODx Co-Founder - Create and do more with less.