We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23217
    • 44 Posts
    I have a site that is working (and even public!). I now have the task of setting things up with friendly urls. I read the Wiki topic on this, and began trying to move that direction. However, the Wiki says that turning on Friendly URLs and setting the "prefix" value to something like "index.php?page=" should cause pages to render as "index.php?page=101", for example. For me, it does not. Is there some basic boneheaded mistake I am making?

    P
      • 16278
      • 928 Posts
      You have installed the .htaccess file as well, of course? wink
      (See note for first field of Tools > Configuration > Friendly URLs).

      Re the prefix, it’s just the "page=" you need in that field.

      KP
        • 23217
        • 44 Posts
        Yep. I copied .htaccess from ht.access in both the root and the manager folder. I turned rewrite on in Apache. I set the prefix to path= (per your suggestion) and when I preview a page on the site I see index.php?id=101 (so to speak). I tried setting a location to index.php?page=101 and that gives me the home page (as if no id were specified).

        I have done a variety of things during this process, and have set an alias for various documents (since, ultimately, I want to use true friendly urls). Will that impact this? My purpose in doing this is to start from scratch and see what works and what I am doing wrong.

        Thanks for the response. Any further wisdom would be useful.
          • 20288
          • 132 Posts
          Quote from: phayes at Dec 04, 2008, 03:24 PM

          Yep. I copied .htaccess from ht.access in both the root and the manager folder. I turned rewrite on in Apache. I set the prefix to path= (per your suggestion) and when I preview a page on the site I see index.php?id=101 (so to speak). I tried setting a location to index.php?page=101 and that gives me the home page (as if no id were specified).

          I have done a variety of things during this process, and have set an alias for various documents (since, ultimately, I want to use true friendly urls). Will that impact this? My purpose in doing this is to start from scratch and see what works and what I am doing wrong.

          Thanks for the response. Any further wisdom would be useful.

          If you want to use "true" friendly urls (ex: aboutus.html), it’s not too difficult. These are the step’s I’ve gone through on 3 different sites.

          1. Rename ht.access to .htaccess in the Root & Manager folder.
          - If your installation is in the root of your website (meaning, its not installed in a subfolder like www.yourdomain.com/modx/), you don’t have to edit either of these .htaccess files.

          2. Go to Tools > Configuration > Friendly URL’s tab.

          3. Turn the option to "Yes".

          4. I use the extension .html for my webpages, so the Suffix for friendly URLs is .html

          5. That’s it! These steps work for me. Hopefully you can get this to work for you.
            • 16278
            • 928 Posts
            Good idea to start from square one again.
            A couple of things to try:

            - make sure your .htaccess is active - write a junk line into it and check that you get a server configuration error when you try to access the site. (Then restore it)

            - install a simple test rewrite rule as the first rewrite rule, to check rewriting is working, e.g.
            RewriteRule ^floop$ index.php?id=2 [L]
            Then go to http://<your site>/floop and check you get to your document 2

            - try turning friendly URLs off and back on again in Tools > Configuartion after setting up your .htaccess file. I found this kicked things off in a local installation of Apache where I only recently got rewrites working at all (after updating the httpd.conf file).

            Alias: If you don’t put anything in the alias field, the document number will be used as the name (once you get the rewrites working, that is), so document 7 will appear as [prefix]7[suffix] in the address line
              • 11316
              • 81 Posts
              Don’t know if I anyone has this issue? My SEF is working fine but I am trying to create this setup - virtual folders. Followed the wiki modx but no luck. Am I missing something in the htaccess?
              I have turned on Duplicate Aliases - but none of my links will show the in the virtual file setup any help would be greatly appreciated.

              - MODX Wiki - Friendly URLs Guide
              * Blog
              o Cars
              + Did you know that a car has four wheels?
              o Girls
              * About me
              * Etc

              How can I get a url to that blog page to be like www.mysite.com/Blog/Cars/Did-you-know-that-a-car-has-four-wheels you ask? Here’s the steps to do just that...
                • 4310
                • 2,310 Posts
                From the Manager Configuration => Friendly URL’s => Use friendly alias path: Yes
                Should do it.
                  • 17261
                  • 18 Posts
                  Question: Setting up Friendly URLs won’t cause any potential security issues, will it? All it does is allow the URL to be rewritten to shorten it, right?
                    • 16278
                    • 928 Posts
                    Friendly URLs should enhance security - for one thing, you don’t have to advertise that you’re using PHP or another scripting language, so you avoid those people looking to exploit weaknesses in it. For another, you don’t get your URLs listed in search engines with query strings, and query strings seem to be something of a magnet for some hackers/spammers.
                    rolleyes KP
                      • 23217
                      • 44 Posts
                      I finally got the friendly url stuff working (with full friendly urls). I found I needed to set the RewriteBase due to how my local server is configured. Had interestingly mixed results getting just the changes to prefix/suffix to work. Never did figure out how to make it work "first time, every time".

                      Thanks for all the input, gang.

                      P