We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29073
    • 9 Posts
    Quote from: sottwell at Feb 19, 2008, 01:06 AM

    First, you need to do as you said, make sure the RewriteBase points to your MODx root. For example, on a remote live site it will most likely be just / to indicate the web root, while on my local dev sites they would be /0962 and /097-a, or /clientname for an installation for developing for a client.

    Then you need to rename them to .htaccess. I always copy them and rename the copy so that I don’t accidentally lose the original. OS X Finder won’t let me save "hidden" files like that, so I have to use the terminal and do a "cp ht.access .htaccess" at the command line. Via FTP I duplicate the file with the new name. You also need to rename or copy and rename the one in the /manager folder; that turns off the rewrite engine for manager pages.

    Then turn on Friendly URLs.

    It’s also possible you may need to uncomment the line above the "rewrite engine on" line to have the server follow symlinks. Some hosts require this, some don’t, and some have it set already in the server configuration. My remote virual private server requires it, which I discovered the hard way when I first set it up, and the results of the research I did is that the line is now in the ht.access file in case somebody needs it. It doesn’t hurt to have it uncommented even if you don’t need it, but there’s no point in making the server parse it if it isn’t necessary. On the other hand, the server does tend to behave erratically if you have the rewrite engine turned on more than once, so it’s a good idea to make sure you don’t have an .htaccess files "upstream" of your MODx installation already turning it on.

    Hi Sottwell,
    I have tried those a few times, but they don’t seem to work. First, I edit my .htaccess in dreamwaever, and it saved as dreamwaever file. Also, I guess maybe I don’t really know where to point to the host. I sort of tried all the different ways and the best i could get was to get it display the address with friendly urls right, but it shows me "404 not found" error code. I don’t really think I can use friendly urls in my website. I know it is better for SEO though. By the way, what does "Prefix for friendly URLs:" mean? I pasted the code from .htaccess for RewriteBase url into that part, and it totally not working at all, so I took it off. By the way, I think the url in "File Manager Path:" in tools-configuration is the one to the root, but it doesn’t seem to work in .htaccess. How can I find out what is the path to the root of my site? I think that is the biggest problem to me. Do they have any program to test that online?
    thank you,

      Ying
      -------------------
      Web Designer
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Ok. As you have surmised, you cannot use Dreamweaver to edit the .htaccess file. Use Textpad or something that will save as pure text.

      Ignore the prefix, that’s just if you want something added to the link when the link is created. The friendly URL link is made of the prefix, the page’s alias, and the suffix (usually .html).

      You should not have to change anything at all in your .htaccess file except the one line:
      RewriteBase /0962

      That line is for one of my development installations. My full path is /Applications/MAMP/htdocs/0962. The htdocs folder is my "web root". If I had MODx installed there directly, the RewriteBase value would simply be /.
      RewriteBase /

      What I’m telling Apache is to apply my rewrite rules starting from that point. Apache only messes with what is in its web space (anything inside that htdocs folder in my case), so Apache’s web root is that folder. They can have different names, public_html and www are other common names. They are all represented by the /. Any time you want Apache to start from a different point, such as a MODx installation in /Applications/MAMP/htdocs/0962, you have to tell it where to start, in this case /0962.

      You can uncomment (remove the # from the beginning) the line above that, the one that says
      Options +FollowSymlinks

      Some servers need it, some don’t , but it doesn’t hurt anything if it is there.
        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
        • 29073
        • 9 Posts
        Ok... I tried all of that, but it still gave me page not found error code.
        I install my cms in public_html, so I leave .htaccess RewriteBase / as it was.
        I also tried to put RewriteBase /public_html, and that still didn’t work. :’(
        Is there something wrong? It is kind of weird, because it showed up with the Document’s alias name that I entered, but it said it couldn’t find the page. I just don’t know what’s wrong now...
        Thank you for helping,
          Ying
          -------------------
          Web Designer
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Is this a localhost site, or a live domain on the Internet?
            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
            • 29073
            • 9 Posts
            Quote from: sottwell at Feb 21, 2008, 01:13 AM

            Is this a localhost site, or a live domain on the Internet?

            It is a live domain on the internet
              Ying
              -------------------
              Web Designer
              • 3749
              • 24,544 Posts
              Sylph,

              When I go to http://www.visionmountain.com/, your whole site is there and looks fine (friendly URLs are off).

              When I go to http://visionmountain.com/, I’m asked for a username and password so that URL must be being redirected to a password protected directory.

              If you paste the contents of your entire .htaccess file into a message here, we might see something that could help you.

              Bob
                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