We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50628
    • 10 Posts
    Hi, i tried to create a web-site for testing purposes with MODx revo.
    Now i faced with a problem that when I use Wayfinder for creating menus and friendlyURLs for SEO optimization, every page except main-one give me 404 error. Every page link generated with url like "http://<web-site-name>/<alias>.html", but as i could understood from manual - page url should be somehow converted to /index.php?id=<alias>.php.
    I also tried to change ht.access, but it gave me no result. Could some one help me with it, i think there should be easy solution of this problem, and i missing something.

    p.s. My hoster told that mod_rewrite is ON.

    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^edent3.zz\.mu [NC]
    RewriteRule (.*)  http://www.edent3.zz.mu/$1 [R=301,L]
    
    # Do not remove this line or mod_rewrite rules and search engine friendly URLs will stop working
    RewriteBase /
    
    # DO NOT REMOVE THIS LINE AND THE LINES BELOW ERRORPAGEID:qyLuQy
    ErrorDocument 404 /404.html
    # DO NOT REMOVE THIS LINE AND THE LINES ABOVE qyLuQy:ERRORPAGEID
    
    
    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] 

    This question has been answered by multiple community members. See the first response.

    • Is the site in a subdirectory?
        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
        • 50628
        • 10 Posts
        Quote from: sottwell at Jun 18, 2015, 01:47 PM
        Is the site in a subdirectory?
        Site is in root directory.
        • With Friendly URLs enabled, the MODX makeURL() function will create a URL like "page.html". So menu snippets that use that API function will generate "domain.com/page.html" or "domain.com/parent/page.html".

          The .htaccess rewrite rule pulls off the part after "domain.com/" and gives it to MODX as "index.php?q=page.html". Then MODX parses that to determine which resource has that alias, or alias path in the case of "q=parent/page.html".
            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
          • Do you have the tag <base href="[[++site_url]]"> in your template's head?
              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
            • discuss.answer
              • 22840
              • 1,572 Posts
              I also tried to change ht.access, but it gave me no result

              Did you rename it to .htaccess
                • 3749
                • 24,544 Posts
                Do you have multiple front-end contexts (i.e., other contexts besides 'web')?
                  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
                  • 50628
                  • 10 Posts
                  Quote from: sottwell at Jun 19, 2015, 06:11 AM
                  Do you have the tag <base href="[[++site_url]]"> in your template's head?
                  Yes,
                  <!DOCTYPE html>
                  <html>
                  <head>
                  <link rel="shortcut icon" href="/assets/images/favico.png" type="image/png">
                  <title>[[++site_name]] - [[*pagetitle]]</title>
                  <base href="[[++site_url]]" />
                  </head>
                  ...
                  


                  Quote from: paulp at Jun 19, 2015, 08:35 AM
                  I also tried to change ht.access, but it gave me no result
                  Did you rename it to .htaccess
                  Yes.

                  Quote from: BobRay at Jun 20, 2015, 07:16 AM
                  Do you have multiple front-end contexts (i.e., other contexts besides 'web')?
                  I'm not sure, i think - no.

                  Quote from: sottwell at Jun 19, 2015, 06:10 AM
                  With Friendly URLs enabled, the MODX makeURL() function will create a URL like "page.html". ...

                  i tried to put http://<domain.com>/index.php?id=3 into address line - and it was converted to http://<domain.com>/<alias>.html, and results error 404.
                  If i enter http://<domain.com>/index.php?id=<alias>.html (or without html), i just get to the home page, so i'm not sure that
                  ... and gives it to MODX as "index.php?q=page.html". Then MODX parses that to determine which resource has that alias, or alias path in the case of "q=parent/page.html".
                  this part works as should.

                  I also tried to clear cache in MODx and web-browser.
                    • 3749
                    • 24,544 Posts
                    Try turning off the FURLs System Setting, logging out, deleting all files in the core/cache directory, then logging in and turning them back on.

                    If you just go to yoursite.com, does your home page come up?

                    Is the site running IIS (as opposed to Apache), or nginx?
                      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
                      • 50628
                      • 10 Posts
                      Quote from: BobRay at Jun 22, 2015, 04:32 AM
                      Try turning off the FURLs System Setting, logging out, deleting all files in the core/cache directory, then logging in and turning them back on.

                      If you just go to yoursite.com, does your home page come up?

                      Is the site running IIS (as opposed to Apache), or nginx?

                      It didn't helps.
                      Yes, home page comes up (you can check it if you want, i'm using it for test purposes http://edent3.zz.mu/ ).
                      Hosting runs on Apache 2.2.