We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30223
    • 1,010 Posts
    try <domain>/index.php?id=<id> smiley
      • 19726
      • 239 Posts
      Or if you really want to use the <domain>/<id>.html format, you can just enable friendly urls (this will provide the .html postfix) and remove the aliases from the documents. I think that if a document has no alias the doc ID will be used.
        • 20765
        • 90 Posts
        myfriendscallmebill Reply #43, 20 years, 1 month ago
        Quote from: Mitch at Aug 18, 2006, 11:19 AM

        Or if you really want to use the <domain>/<id>.html format, you can just enable friendly urls...
        Friendly URLs is on. It’s the "use friendly aliases" setting on the friendly URL page I’m having trouble with.

        Quote from: Mitch at Aug 18, 2006, 11:19 AM

        I think that if a document has no alias the doc ID will be used.
        That’s what happens for me, and as a workaround I’m thinking of leaving "use friendly aliases" turned on (so that the website works) and just telling the client not to enter any document aliases (so that only doc IDs are shown in the URL).

        Quote from: TobyL at Aug 18, 2006, 02:12 AM

        try <domain>/index.php?id=<id> smiley
        I don’t think this will work in my case. I need to be able to accept URLs from Google, et al that have query strings attached. Wouldn’t using query string "?id=<id>" on every URL interfere with that?
          • 30223
          • 1,010 Posts
          Now lets step back a bit and recap...

          You want friendly_urls to stay on to keep your pages search engine friendly. ("Use friendly urls" = yes)
          You don’t want to use the page alias. ("Use friendly aliases" = no)
          You want the page to end in .html ( "Suffix for friendly URLs" = ".html")
          You don’t want a prefix so that only the page id is used ("Prefix for friendly URLs" = "")

          This is what you have right? I’ve just changed my settings to just that and have no problem... So what are the urls you are having problems with? "You say anytime I go beyond the homepage" but can you show us what urls these are? (in the status bar when you mouse over a link)

          In the mean time you could just copy the pageid in to the page alias field and keep friendly aliases on. Mind you if you have
          "Use friendly alias path" = yes this might give you rather numeric urls such as http://somedomain/9/12/34.html (hmm,... if you have enough pages you could make a page for your birthday - http://mydomain/28/12/1978.html for example smiley

          But seriously let me know what the urls are and what the other settings in the system administration are. let’s see if we can clear this up
            • 20765
            • 90 Posts
            myfriendscallmebill Reply #45, 20 years, 1 month ago
            Quote from: TobyL at Aug 21, 2006, 06:54 AM

            You want friendly_urls to stay on to keep your pages search engine friendly.  ("Use friendly urls" = yes)
            You don’t want to use the page alias. ("Use friendly aliases" = no)
            You want the page to end in .html ( "Suffix for friendly URLs" = ".html")
            You don’t want a prefix so that only the page id is used ("Prefix for friendly URLs" = "")

            This is what you have right? I’ve just changed my settings to just that and have no problem...

            With "Use friendly aliases" on, I also have no problem.  But with "Use friendly aliases" off every link fails.  When I click on any link the browsers address bar shows <domain>.<id>.html, but every link results in the "page not found" error page.  On the other hand, if I manually type into the address bar <domain>.<id> (no ".html" at the end), I can successfully get to every page of my website.

            I have also found that if, in addition to turning off "use friendly aliases:"  I also empty the "Suffix for friendly URLs" box, then the links on my web pages start working again (and the URLs that show up in the address bar are in the form <domain>.<id> (no ".html" at the end)).

            So I can either have "use friendly aliases" on and have a ".html" suffix, or I can have use friendly aliases off and have no suffix -- both those combinations work.  But I can’t have "use friendly aliases" off and have a  ".html" suffix -- that combination doesn’t work.
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              If you are using friendly URLs, and the document has an alias, the alias will always have precedence over the friendly URL. By setting this option to ’yes’, the friendly URL prefix and suffix will also be applied to the alias. For example, if your document with ID 1 has an alias of `introduction`, and you’ve set a prefix of `` and a suffix of `.html`, setting this option to `yes` will generate `introduction.html`. If there’s no alias, MODx will generate `1.html` as link.

              It looks from this as if no prefix or suffix will be added if you set this to no.

              I’ll run through this on my site and see what happens.
                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
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Hm. Setting "Use Friendly URLs" to yes, and everything else to no, uses <docID>.html for every page, even though most of them have aliases. And the links all work just fine. This is with my MODx installation in my web root, and the stock ht.access files simply renamed to .htaccess.

                  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
                  • 30223
                  • 1,010 Posts
                  Yes, it might be worth looking at .htaccess at your end or at the server configuration. Perhaps there’s some handler or rewrite or redirection happening that interferes... What happens if you set the suffix to ".htm" or ".modx" Does the site work then?
                    • 20765
                    • 90 Posts
                    myfriendscallmebill Reply #49, 20 years, 1 month ago
                    OK, I found my problem.

                    First I did a clean install of MODx on my desktop machine, renamed "ht.access" to ".htaccess", turned on friendly URLs, turned off "use friendly aliases", and the default MODx website worked fine.

                    Then I took TobyL’s advice and looked at the ".htaccess" file on my development server (that’s hosted by a web hosting company on a shared, virtual server). My installation there is in a subdirectory, that’s accessed via a subdomain URL (modx.example.com).

                    You know the lines in the .htaccess file that read:

                    # If your MODx installation is in a subdirectory, change the following line to match the physical
                    # path to the "root" of the site as follows:
                    # RewriteRule ^(.*)$ /path/to/subdirectory/index.php?q=$1 [L,QSA]

                    Well when I initially set up friendly URLs with "use friendly aliases" turned on, I also set that final line to be:

                    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

                    and everything was fine until I tried turning "use friendly aliases" off. Well, I went back and edited this line to add the "/path/to/subdirectory/" per the instructions and it started working just find (although I had to refresh the site to get the FirstChildRedirect snippet to work correctly).

                    By the way, in case anyone else has this problem, the true path to the MODx subdirectory was longer than I expected. It took some experimentation to find that what I needed was:

                    RewriteRule ^(.*)$ /home/myusername/public_html/mysubdirectoryname/index.php?q=$1 [L,QSA]

                    Hope all this is of help to someone...
                      • 22303 MODX Staff
                      • 10,725 Posts
                      Quote from: myfriendscallmebill at Aug 23, 2006, 05:54 AM

                      By the way, in case anyone else has this problem, the true path to the MODx subdirectory was longer than I expected. It took some experimentation to find that what I needed was:

                      RewriteRule ^(.*)$ /home/myusername/public_html/mysubdirectoryname/index.php?q=$1 [L,QSA]

                      The path should be from the document root of the web server, which I would think would simply be...

                      RewriteRule ^(.*)$ /mysubdirectoryname/index.php?q=$1 [L,QSA]

                      That it works on your configuration that way has me wondering how, and does it not work with the path simply specified from the document root?

                      This discussion is closed to further replies. Keep calm and carry on.