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

    I am currently doing some research on CMSs I could use to redevelop a corporate website with a few different types of content (standard pages, news articles, testimonials) and trying to avoid developing something far inferior from scratch to accommodate the project’s custom requirements!

    I have no experience of major CMS packages and never heard of Modx before yesterday - shame on me! smiley I’m really glad I found it, as having had a quick demo of several others, I think it’s definitely the one that seems flexible yet straightforward to use and I’m impressed by the web standards and API approach.

    One vital requirement is that the CMS is entirely SEO friendly. I am pleased to see that the metadata is editable on every page, but keyword rich / parameter free URLs are a must.

    The only problem is that the site is hosted on IIS 6 / Windows Server 2003. The client currently uses a module called IISRewrite (http://www.qwerksoft.com/products/iisrewrite/) to replicate Apache’s mod rewrite .htaccess behaviour, so that is available.

    However, I am wondering if it will really be practical to set up and maintain friendly URLs as the site grows on IIS. I read a previous post http://modxcms.com/forums/index.php/topic,634.0.html which suggested that Mods can accommodate friendly URLs by utilising IIS’s custom error URLs. However, some of this went a bit over my head I’m afraid! Does using that approach mean that every page requested raises a 404 error which then redirects to another page? Would this mean that search engine spiders would receive strange response codes in crawling the site?

    I know that post may be quite out of date, given the rapid development progress that I sense! Can keyword rich URLs be easily accommodated on IIS?

    Many thanks in advance,
    fizzy smiley
      • 9763
      • 16 Posts
      I managed to get the friendly URLs to work on IIS 6 using the IISRewrite component we already had in place. So, in case it is of use to anyone else, here’s the setup it needed:

      1) Set use friendly URLs to yes
      2) Enter a suffix for the pages e.g. .html (I could not get it to work sitewide without one, but I ain’t too familiar with writing rewrite rules)
      2) In the IISRewrite ini file, enter the following:

      RewriteEngine On
      Rewrite Rule ^/manager/.* - [L]
      Rewrite Rule ^/assets/.* - [L]
      RewriteRule /(.*).html /index.php?q=$1

      The first 2 rules have the effect of turning off URL rewriting for the manager and assets folders (since they leave the URLs untouched)
      Replace .html in the last rule with the suffix you specified, restart IIS and your friendly URLs should work.

      Hope this helps,
      Fizzy smiley
        • 32963
        • 1,732 Posts
        Hi Fizzy,

        Good going!

        Don’t know if you knew that you can use friendly URLs on IIS without such a component?

        Here’s how it works:

        * Assign your custom 405 and 404 urls to point to /index.php.

        * Enable friendly URLs from the Manager and that’s it!


          xWisdom
          www.xwisdomhtml.com
          The fear of the Lord is the beginning of wisdom:
          MODx Co-Founder - Create and do more with less.
          • 32241
          • 1,495 Posts
          BUt it will cause every pages having that error warning that will make a bad ranking to search engine I believe.

          This is just my assumption though.
            Wendy Novianto
            [font=Verdana]PT DJAMOER Technology Media
            [font=Verdana]Xituz Media
            • 9763
            • 16 Posts
            Quote from: xwisdom at Mar 02, 2006, 11:21 AM


            Don’t know if you knew that you can use friendly URLs on IIS without such a component?

            Here’s how it works:

            * Assign your custom 405 and 404 urls to point to /index.php.

            * Enable friendly URLs from the Manager and that’s it!


            thanks for confirming this. i had referenced a post from about 6 months ago detailing this (although i think you had to modify some scripts then?)...

            but like djamoer, i was concerned by how search engines would be able to cope with this. do all pages give up a 404 error code? apologies if that sounds stupid! when i did not receive quick replies confirming the iis custom 404 redirect method was search engine friendly, i figured i better try and use our url rewriting component.

            it is *vital* that the site is super search engine friendly since it is for a search marketing agency! smiley i don’t have a few months to try it on a test domain and wait for it to be indexed in the engines, and the real site will only really get one shot - if the spiders don’t like something, it is hard to get them back on side smiley

            so, it would be *great* if someone could confirm that they have used the iis custom error page method and are enjoying decent search engine rankings. especially, since i am having problems with nested folders within the manager folder having url rewriting applied at the moment, so i need to find a way of rewriting my rules to accommodate this - think i was a bit hasty with marking this topic solved! (btw another newbie question - is that the convention - original poster marks topic solved when their query is answered?)
              • 32241
              • 1,495 Posts
              Quote from: fizzy at Mar 02, 2006, 03:11 PM

              (btw another newbie question - is that the convention - original poster marks topic solved when their query is answered?)

              Yep,

              First it helps problem solver like us to help you guys out know that this topic had been solved, second it also helps other users that have the same problem to know that their problem had been answered, or if not, they can continue bumping up the topic and try to find the right solution.

              Hope you find it useful this way grin
                Wendy Novianto
                [font=Verdana]PT DJAMOER Technology Media
                [font=Verdana]Xituz Media
                • 3384
                • 9 Posts
                I just wanted to thank you guys and fizzy for posting this. Quality stuff!!

                I’ve been trying to get this to work for 2 days and now finally found this solution and it works.

                Thanks again.
                  • 3384
                  • 9 Posts
                  Just to point out that there shouldn’t be a space in "Rewrite Rule".

                  It should be -

                  RewriteEngine On
                  RewriteRule ^/manager/.* - [L]
                  RewriteRule ^/assets/.* - [L]
                  RewriteRule /(.*).html /index.php?q=$1

                  Quote from: fizzy at Mar 02, 2006, 09:12 AM

                  I managed to get the friendly URLs to work on IIS 6 using the IISRewrite component we already had in place. So, in case it is of use to anyone else, here’s the setup it needed:

                  1) Set use friendly URLs to yes
                  2) Enter a suffix for the pages e.g. .html (I could not get it to work sitewide without one, but I ain’t too familiar with writing rewrite rules)
                  2) In the IISRewrite ini file, enter the following:

                  RewriteEngine On
                  Rewrite Rule ^/manager/.* - [L]
                  Rewrite Rule ^/assets/.* - [L]
                  RewriteRule /(.*).html /index.php?q=$1

                  The first 2 rules have the effect of turning off URL rewriting for the manager and assets folders (since they leave the URLs untouched)
                  Replace .html in the last rule with the suffix you specified, restart IIS and your friendly URLs should work.

                  Hope this helps,
                  Fizzy smiley

                    • 9314
                    • 1 Posts
                    I tried the above technique creating the IISRewrite.ini file with this in it:
                    RewriteEngine On
                    RewriteRule ^/manager/.* - [L]
                    RewriteRule ^/assets/.* - [L]
                    RewriteRule /(.*).html /index.php?q=$1
                    I made the suggested settings in the admin panel. I can get the home page okay but when I browse to the other pages I get the friendly URL but the page doesn’t render. Instead I get the following error -
                    =================================================
                    *{margin:0;padding:0} body{margin:50px;background:#eee;} .install{padding:10px;border:5px solid #f22;background:#f99;margin:0 auto;font:120%/1em serif;text-align:center;} p{ margin:20px 0; } a{font-size:200%;color:#f22;text-decoration:underline;margin-top: 30px;padding: 5px;}
                    MODx is not currently installed or the configuration file cannot be found.

                    Do you want to install now?

                    "; exit; } } // start session startCMSSession(); // initiate a new document parser include_once(MODX_MANAGER_PATH.’/includes/document.parser.class.inc.php’); $modx = new DocumentParser; $etomite = &$modx; // for backward compatibility // set some parser options $modx->minParserPasses = 1; // min number of parser recursive loops or passes $modx->maxParserPasses = 10; // max number of parser recursive loops or passes $modx->dumpSQL = false; $modx->dumpSnippets = false; // feed the parser the execution start time $modx->tstart = $tstart; // Debugging mode: $modx->stopOnNotice = false; // Don’t show PHP errors to the public if(!isset($_SESSION[’mgrValidated’]) || !$_SESSION[’mgrValidated’]) { @ini_set("display_errors","0"); } // execute the parser if index.php was not included if (!MODX_API_MODE) { $modx->executeParser(); } ?>
                    ======================================================================
                    Did I miss something
                      • 30176
                      • 99 Posts
                      I am a newb here but walked this same path about a month ago. With the following code my site is working well. I am in a /modx subdirectory. I am using Ionics rewrite filter.

                      Here is my .ini file
                      RewriteEngine on
                      StatusUrl /iirfStatus
                      RewriteRule ^/modx/manager/.* - [L]
                      RewriteRule ^/modx/assets/.* - [L]
                      RewriteRule ^/modx/(.*).html /modx/index.php?q=$1 [L,QSA]
                      


                      On yours differing from mine, a missing ^ on the last rewrite rule. I hope this helps.
                        "Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
                        -J.R.R. Tolkien from The Lord of the Rings