We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23491 ☆ A M B ☆
    • 1,056 Posts
    This is very nice!

    Regarding
    <?php 
    // ...
    $myProtocol = $_SERVER['HTTPS'] == on ? "https://" : "http://";
    


    ...I think it should derive this from modx->config, since it is already configurable via the GUI/manager


    Also, I wouldn’t recommend HARD CODING the `modx_` prefix, else this will run into compatibility issues with certain users...
      Mike Reid - www.pixelchutes.com
      MODx Ambassador / Contributor
      [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
      ________________________________
      Where every pixel matters.
      • 25663 MODX Staff
      • 12,272 Posts
      Actually, the protocol can change inside a site, like on ecommerce applications, so I wouldn’t hard code it to the modx configuration. Or am I thinking incorrectly?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 23491 ☆ A M B ☆
        • 1,056 Posts
        You’re definitely correct... I guess I should start my asking how/where the Protocol definition within Manager > Config is used? Hmm...

        Seriously though, SEO Strict w/ this add on... +1 for Core Release if you want my opinion. I had hoped something like this was do-able in MODx since the beginning!
          Mike Reid - www.pixelchutes.com
          MODx Ambassador / Contributor
          [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
          ________________________________
          Where every pixel matters.
          • 6726
          • 7,075 Posts
          This is way beyond my skillset but I grasp the general idea (also learning along the way) and I say this plugin is really a great thing for MODx and is a must have for any pro using MODx in the long run... great work, keep it up !
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l&#39;outil id
            • 23491 ☆ A M B ☆
            • 1,056 Posts
            Quote from: davidm at Jan 11, 2007, 05:37 PM

            This is way beyond my skillset but I grasp the general idea (also learning along the way) and I say this plugin is really a great thing for MODx and is a must have for any pro using MODx in the long run... great work, keep it up !

            Honestly, I didn’t quite understand it myself (quickly reading through the first time) ...

            Here are some of the features I personally like:

            1. If my site root is aliased as "home.html", www.mysite.com and www.mysite.com/home.html would previously take you to the same page, each with an appropriate HTTP response code of 200. Unfortunately, with SEO in mind, this is less than ideal being that search engines treat this as 2 separate pages. In fact, my domain root (/) today is a PR 4, but my same page (alias: /index.html) is PR 0

            With this plugin, it determines your site’s root by using [(site_start)], and then redirects to root (/) with a 301 response code...Good! It really goes to the next level by checking any generated FURLs in the actual Content and rewriting all instances of, in my case, /index.html with just /. So now, site-wide, /index.html doesn’t exist, and old references are all 301’d to / too... Very cool laugh

            2. With ApoXX’s new add-on, you can simply define a CSS document, or XML feed, etc. and give an alias of say: MyFeed.XML, or Style.CSS... simply select "Base Name" from the TV, and this specific page does not get your FURL Extension appended to it, e.g. No more MyFeed.xml.html ... this is nice because you can still leverage the FURL extension in Manager > Config, whereas previous approaches you had to leave it blank and alias with your extension at the Page-level.

            Another thing I really like is how if I browse to www.mysite.com/MyFeed.rss.html, it will determine the existence of the defined alias, and 301 to the proper www.mysite.com/MyFeed.rss smiley
              Mike Reid - www.pixelchutes.com
              MODx Ambassador / Contributor
              [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
              ________________________________
              Where every pixel matters.
              • 27376
              • 576 Posts
              This is truly remarkable! Very well done!

              I won’t implement this on my site immediately, but it will definitely be done in the near future because URL strings are very important if you want to be recognized by search engines!
                • 25663 MODX Staff
                • 12,272 Posts
                This is awesome guys. GREAT work. smiley
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 33337
                  • 3,975 Posts
                  Quote from: rthrash at Jan 13, 2007, 08:23 AM

                  This is awesome guys. GREAT work. smiley

                  woooo! laugh
                    Zaigham R - MODX Professional | Skype | Email | Twitter

                    Digging the interwebs for #MODX gems and bringing it to you. modx.link
                    • 23491 ☆ A M B ☆
                    • 1,056 Posts
                    Quote from: sirlancelot at Jan 13, 2007, 05:27 AM

                    This is truly remarkable! Very well done!

                    I won’t implement this on my site immediately, but it will definitely be done in the near future because URL strings are very important if you want to be recognized by search engines!

                    @zi,rthrash,sirlancelot,

                    If you haven’t tested, installation is a snap! Try copy/pasting the plugin (check system events) and creating the TV and you’re in business wink Simply disable the plugin to deactivate (of course)

                    There is an XML Sitemap snippet floating around (can’t recall the name), and this plugin works there, too! So even your XML Sitemaps are SEO-strict laugh
                      Mike Reid - www.pixelchutes.com
                      MODx Ambassador / Contributor
                      [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                      ________________________________
                      Where every pixel matters.
                      • 27376
                      • 576 Posts
                      OK so by near future I meant yesterday smiley

                      I gave this plugin a try, and it certainly was a very simple install, another marvel of MODx!

                      There is one issue, here’s the scenario: when $editMenuLinks is 1, during the "OnWebPagePrerender" event, the url is formatted incorrectly when you click to the home page (I have MODx running on a subfolder of my domain). What it does is duplicate the folders after the domain, so instead of "www.example.com/production/MODx" you end up with "www.example.com/production/MODx/production/MODx". I tracked down this little bug and here’s the fix:
                      <?php // Line: 100
                      elseif($e->name=='OnWebPagePrerender')
                      {
                         if ($editMenuLinks)
                         {
                            $o = &$modx->documentOutput; // get a reference of the output
                            $base_str = basename($modx->makeUrl($modx->config['site_start']));
                            $o = preg_replace("#/?$base_str#",'/',$o); // FIXED: remove the site_start identifier instead of duplicating base_url
                         }
                      ?>

                      This may require more testing but it fixed my problem.

                      EDIT: I also agree that this should be a core release, but it may confuse some people, so possibly make it an optional plugin during the install process.

                      UPDATE: The code change is for the second edition of this plugin located here.