We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45778
    • 75 Posts
    My friendly URLs are working if you type in the alias (e.g. http://mysite.com/products) but at some point in the somewhat recent past, the system stopped converting the raw MODX URL into a friendly version. So if you type

    http://mysite.com/index.php?id=12

    The URL stays like that. It used to convert to http://mysite.com/products. Now it doesn't.

    I haven't changed anything in the .htaccess file, and as far as I know I haven't made any changes to the MODX system settings that would cause a change in behavior. It's possible that our server administrator may have changed something in the Apache config, but I'm not even sure what would make a difference. Where should I look to fix this?
      • 3749
      • 24,544 Posts
      Some hosts will implement fixes by rewriting .htaccess. Make sure it still has Friendly URLs part and it's uncommented. Also, make sure the RewriteEngine On line is there.

      It's also possible that they have accidentally disabled the rewrite engine in a server upgrade.
        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
        • 36551
        • 416 Posts
        I've got a similar problem to this one.

        This site has been up for a couple of years. Today, my client noticed in there SEO analysis, a duplicate page. Turns out the page in question is returned by the friendly url alias AND the index.php?id= url for that page.

        I found quite a few more that behaved the same way, pages returned with the FURL and the Index URL. It's a big site so there I haven't checked every single URL.

        All the pages in question have unique url alias's as they should. The main navigation and all other links are working with Friendly URLs as expected and returning pages with the friendly url.

        So Friendly URL are working but so are the index URLs.

        I checked the .htaccess. All looks normal. Clearing the Modx cache had not effect.

        Modx 2.5.0

        Any ideas?
          • 3749
          • 24,544 Posts
          You mean index.php?id=resourceId (not URL), right?

          I can't duplicate this on my site (though it's still on 2.4.4). Using either the ID or the URL redirects to the home page every time.

          Does this happen when you type the non-friendly URL in the browser's address bar, or just in the SEO analysis?

          The odd question is, where did they get those non-friendly URLs from. I assume they're working from links on the pages and none of them should look like that, so where did they come from. How would the software even know the resource IDs?
            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
            • 36551
            • 416 Posts
            Bob

            When I put this index.php?id=2 in the browser address bar it displays that resource as if friendly urls were not activated. When I put in the friendly url or navigate with the menu it is also displayed. It's not just one page. I can do this on many others.

            I can't recreate this on any of my other sites either. I've not seen this before. It's usually all one way or the other.

            This is the htaccess

            RewriteEngine On
            RewriteBase /
            
            RewriteCond %{HTTP_HOST} .
            RewriteCond %{HTTP_HOST} !^www\.xxxxxx\.com [NC]
            RewriteRule (.*) http://www.xxxxxx.com/$1 [R=301,L]
            
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
            
            

              • 3749
              • 24,544 Posts
              And the friendly_urls System Setting is set to "yes"?
                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
                • 36551
                • 416 Posts
                Bob

                Yes, set to yes.

                Sorry for the slow response, I'm not getting emails with for responses.
                  • 36551
                  • 416 Posts
                  I've been checking other sites and I'm seeing this behavior on several other sites. It must be something in the .htaccess that's not right. Yes?
                    • 22840
                    • 1,572 Posts
                    Can confirm that on 2.2.16 index.php?id=3 redirects to the friendly url, however on 2.5.1 ( havent got any other versions installed ) it does not redirect to the friendly url, so technically the site can be accessed on both index.php?id=3 and /aboutus.html which is duplicate content, the rewrite part of the .htaccess are identical so there must be something else going on here.

                    Will have to do a bit of testing
                      • 36551
                      • 416 Posts
                      The sites I've checked so far are running 2.5.0 and have the same, out of the box, htaccess.

                      However, I do have a site running 2.5.0, that DOES rewrite correctly to the friendly url. The htaccess is the same except this site is in a subdirectory.

                      I also have another site running 2.5.1 that DOES rewrite correctly to the friendly url. The htaccess is not exactly similar, but the friendly url part is identical to those that do not rewrite.