We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42961
    • 10 Posts
    Hello. smiley

    I'm running Modx 2.2.6 and have been putting my first website together in it. Everything was working fine until I started configuring FURLs, and now I can only see the initial page.

    My site structure is arranged like:

    Web
    -- Home
    ---- Sub 1
    ------- Sub 1a
    ------- Sub 1b
    ---- Sub 2
    ------ Sub 2a
    ------ Sub 2b

    So I can end up with a URL that looks like http://localhost/mysitesubfolder/home/sub-1/sub-1a.html but it still shows me the "home.html" content.
      • 3749
      • 24,544 Posts
      Do you have this tag in the head section of all templates:

      <base href = "[[++site_url]]" />


      Did you rename the ht.access file in the MODX root to .htaccess?
        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
        • 42961
        • 10 Posts
        I do have the base href in my templates.. I've tried both of the different variations I've seen of it.

        <base href = "[[++site_url]]" />
        
        <base href = "[[!++site_url]]" />



        I've moved the ht.access file to my localhost root, renamed it to .htaccess and tweaked it as follows:

        # Friendly URLs Part
        RewriteEngine On
        RewriteBase /mysitesubfolder
        RewriteCond %{HTTP_HOST} .
        # Force all pages to go to www.domain.com for SEO
        RewriteCond %{HTTP_HOST} !^localhost [NC]
        RewriteRule (.*) http://localhost/$1 [R=301,L]
        # Friendly URLs
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
        


        I've also tried it with these lines commented out:

        # Force all pages to go to www.domain.com for SEO
        #RewriteCond %{HTTP_HOST} !^localhost [NC]
        #RewriteRule (.*) http://localhost/$1 [R=301,L]


        Just trying a few different fixes that I've googled...
          • 3749
          • 24,544 Posts
          Often, you don't need this except on localhost installs:

          RewriteBase /mysitesubfolder


          Try

          RewriteBase /
            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
            • 42562
            • 1,145 Posts
            This is what I use.
            RewriteEngine On
            RewriteBase /mysitesubfolder/
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
            Tried this, two /slashes/ --------- RewriteBase /mysitesubfolder/ ?
            Automatically generate alias        automatic_alias            Yes
            Use Friendly URLs                   friendly_urls              Yes
            Use Friendly URLs                   friendly_urls              Yes
            Use Friendly Alias Path             use_alias_path             No (in your case - YES)
            
            but it still shows me the "home.html" content.
            What's the meaning? When does it do that? when you try to "view" any page? Try right-clicking on a resource in the manager and say "View Resource" does it come up. what is the URL like? - if it points back to the homepage (which is default for your error_page), there's something wrong : either you are trying this from another Context (other than web)----- or Thor plays cricket (I don't know).

              TinymceWrapper: Complete back/frontend content solution.
              Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
              5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
              • 3749
              • 24,544 Posts
              The home page is the default error_page, so for any file-not-found event, you'll end up there. You'll also end up there if you're trying to view a page without the rights to do so. That will happen if the page is unpublished or if an ACL entry in the permissions system is protecting it.

              The fact that things went fine until you implemented FURLs suggest that your Rewrite Base line is incorrect.
                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
                • 42961
                • 10 Posts
                Quote from: BobRay at Feb 28, 2013, 03:30 PM
                Often, you don't need this except on localhost installs:quote]

                It is a localhost install.


                Quote from: donshakespeare at Feb 28, 2013, 03:40 PM
                This is what I use.
                RewriteBase /mysitesubfolder/

                What's the meaning? When does it do that? when you try to "view" any page?

                A trailing "/" did not make any changes.. but thank you for the suggestion.

                Sorry, I mean that if I visit the URL http://localhost/mysitesubfolder/ it shows me the exact same page if I visit http://localhost/mysitesubfolder/home/sub-1/sub-1a.html

                This was working before I tried to get FURLs working.. I was able to view the contents of that "page" as something like http://localhost/mysitesubfolder/index?id=34 and it did work correctly.
                  • 42961
                  • 10 Posts
                  Quote from: BobRay at Feb 28, 2013, 03:45 PM
                  The home page is the default error_page, so for any file-not-found event, you'll end up there. You'll also end up there if you're trying to view a page without the rights to do so. That will happen if the page is unpublished or if an ACL entry in the permissions system is protecting it.

                  The fact that things went fine until you implemented FURLs suggest that your Rewrite Base line is incorrect.

                  Oh, okay.. not a terribly helpful error message is it? *heh*

                  Thank you. Now I just need to figure out what is incorrect with the Rewrite Base then. smiley
                    • 3749
                    • 24,544 Posts
                    I'd suggest trying donshakespeare's version of .htaccess (with various alterations of the Rewrite Base) and leaving the www/non-www part out for now.

                    What happens when you right-click on a resource in the Manager and select "View" ?

                      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
                      • 42961
                      • 10 Posts
                      Quote from: BobRay at Feb 28, 2013, 03:52 PM
                      I'd suggest trying donshakespeare's version of .htaccess (with various alterations of the Rewrite Base) and leaving the www/non-www part out for now.

                      What happens when you right-click on a resource in the Manager and select "View" ?

                      I've tried donshakespear's version and both versions of Rewrite Base.. also tried switching "Use Friendly Alias Path" to NO and to YES. Clearing the site cache. Restarting the server. None of it has made an difference.

                      If I right click the resource and select "View" it opens in my web browser showing the 'home' page content rather than the page.

                      I wonder if maybe I have done something incorrectly when building the pages... Should all of the pages that contain pages be set as "Container", "Searchable", "Rich Text", "Cacheable" and "Empty Cache"? That is how I currently have them set. Pages that don't have sub pages are the same but don't have "Container" set.