We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37015
    • 21 Posts
    Hi

    I've just set up friendly URL's using the following:
    http://rtfm.modx.com/display/revolution20/Using+Friendly+URLs

    I asked my hosting company (HostGator) to change...

    #LoadModule expires_module modules/mod_expires.so

    to

    LoadModule expires_module modules/mod_expires.so

    However something still isn't working - because when I hit 'view' (in ModX) it returns a 404

    Here is an example page:
    http://information-emporium.co.cc/2/newpage/

    Also why is there a number "2" in there?



    Thanks

    Dan
      • 19369
      • 1,098 Posts
      Also why is there a number "2" in there?

      When you configure Friendly Urls AFTER that you have already created the pages, MODX uses the id of the resource instead of the "friendly" version. You need to open the container page, "2" and save it, in this way it should create the friendly url version.

      About the 404 error:
      1. Do you have the website in the root or in a folder?
      2. Do you have <base href="[ [!++site_url] ]" /> in the header?
        • 37015
        • 21 Posts
        Yeah I have <base href="[ [!++site_url] ]" /> in the header of the template....

        Still 404 :/
          • 19369
          • 1,098 Posts
          1. Do you have the website in the root or in a folder (in the server)?
            • 38723
            • 165 Posts
            Source view of your homepage shows this:

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


            There should be no spaces between the square brackets and no exclamation mark, it should be:

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


            All your menu items seem to be pointing to this broken base_href and an unnamed anchor # which will not go anywhere.

            Have you also ensured that you have renamed ht.access in the root folder to .htaccess - otherwise friendly URLs cannot be rewritten?

            The number two in the url you mention could be caused by a page not being titled correctly (looks like the parent of page "newpage").

              • 19369
              • 1,098 Posts
              He did have the right base tag before, I think he got confused because I pasted it with spaces in my comment. It had 404 error even with the right base though.
                • 38723
                • 165 Posts
                Quote from: microcipcip at Apr 24, 2012, 09:09 AM
                He did have the right base tag before, I think he got confused because I pasted it with spaces in my comment. It had 404 error even with the right base though.


                Hmm. Likely a .htaccess fault? 404s all the time if it's not renamed from ht.access smiley
                  • 37015
                  • 21 Posts
                  Hi

                  Yeah okay got the correct base href in the header now

                  Still 404'ing however.

                  Ignore the menu links - i know they don't go anywhere at the moment smiley

                  For testing purposes use:

                  http://information-emporium.co.cc/items/
                    • 38723
                    • 165 Posts
                    Did you check the .htaccess file in the root folder of the site?
                    What is the resource ID of the "items" page?
                      • 37015
                      • 21 Posts
                      A-ha!

                      Yes it was the .htaccess file. For reference this is now the WORKING contents:

                      # Friendly URLs Part
                      RewriteEngine On
                      RewriteBase /
                      RewriteCond %{HTTP_HOST} .
                      # Force all pages to go to www.domain.com for SEO
                      RewriteCond %{HTTP_HOST} !^www\.information-emporium\.co.cc [NC]
                      RewriteRule (.*) http://www.information-emporium.co.cc/$1 [R=301,L]
                      # Friendly URLs
                      RewriteCond %{REQUEST_FILENAME} !-f
                      RewriteCond %{REQUEST_FILENAME} !-d
                      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                      # Additional Settings Follow
                      ExpiresActive On
                      ExpiresByType image/gif A2592000
                      ExpiresByType image/jpeg A2592000
                      ExpiresByType image/png A2592000
                      BrowserMatch "MSIE" brokenvary=1
                      BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
                      BrowserMatch "Opera" !brokenvary
                      SetEnvIf brokenvary 1 force-no-vary