We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19315
    • 84 Posts
    In light of the significant problem with Php, I’ve now just bit the bullet, deleted everything, and re-installed. Friendly URLs, with alias path, are now working fine.

    Michal.
      • 18367
      • 834 Posts
      I’ve tried just about everything in this post, but I just can’t seem to get friendly urls to work.

      Thing is, I have them working on other non modx directories on my servers so I know the server is set up to do them.

      I just can’t seem to get hem to work for modx.

      I’ve stripped the .htaccess file down to this:

      RewriteEngine On
      RewriteBase /dev/
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ /dev/index.php?q=$1 [L,QSA]

      to keep it simple. (This is the similar format to what I have in my other non modx files)

      I have

      Use Friendly URLs: Yes
      Prefix for friendly URLS: ’’
      suffix for urls: .html
      Use friendly Aliases: Yes
      Use friendly alias paths: No
      Allow duplicate aliases: No
      Automatically generate aliases: Yes

      I really need to get this to work as I want to recreate an existing site in modx, and I obviously need to maintain the file and folder structure.

      Thanks.




        Content Creator and Copywriter
        • 18367
        • 834 Posts
        OK,

        progress of a sort.

        I’m now getting the following error message, which is at least something.


        Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\wamp\www\modx-0961p2\manager\includes\document.parser.class.inc.php(888) : regexp code on line 1

        Fatal error: preg_replace() [<a href=’function.preg-replace’>function.preg-replace</a>]: Failed evaluating code: (1 &amp;&amp; isset($aliases[11]) ? $this-&gt;makeFriendlyURL(’’’’,’.html’,$aliases[11]) : $this-&gt;makeFriendlyURL(’’’’,’.html’,’11’)) in C:\wamp\www\modx-0961p2\manager\includes\document.parser.class.inc.php on line 888

        Can anyone tell me what I’m doing wrong here?

        Thanks again.
          Content Creator and Copywriter
          • 18367
          • 834 Posts
          I’m answering my own questions here.

          I fixed the error, but I still can’t get furls to work in any shape or form.
            Content Creator and Copywriter
            • 22303 MODX Staff
            • 10,725 Posts
            Quote from: markg at May 20, 2008, 08:08 PM

            I’m answering my own questions here.

            I fixed the error, but I still can’t get furls to work in any shape or form.
            Perhaps if you explained more about how it isn’t working? What is the result when you access a page by the expected friendly URL?
              • 18367
              • 834 Posts
              Thanks OG

              the page I’m using is simply called "test"

              When I preview it I get

              http://localhost//modx-0961p2/index.php?id=47

              IF I try and type in http://localhost//modx-0961p2/test or "test.html" I get a page not found message.

                Content Creator and Copywriter
                • 18367
                • 834 Posts
                OK, now this is really getting weird.

                As I was adding new pages I began to notice that some of them were showing up with FURLS.

                Ah ha I said.

                Quick check revealed that some are and some aren’t. All the new pages seem to be fine but

                I still can’t get test.html to show, or any of the older files. I just get a page not found message.

                Explain that one to me?



                  Content Creator and Copywriter
                  • 2912
                  • 315 Posts
                  Perhaps it could be to do with the extra / you have in your URL? You have // before modx and that could be throwing apache rewrite rule off.

                  Try removing the extra / and see what happens. smiley

                    BBloke
                    • 18367
                    • 834 Posts
                    Hmm, how did that get there?

                    Anyway, it’s just as weird. If I remove one of the slashes from the address bar, the new pages still work fine and the old ones still don’t.

                    By the way, how do I get rid of that extra slash?

                    I can’t figure out where it’s coming from.
                      Content Creator and Copywriter
                      • 2912
                      • 315 Posts
                      I’m guessing on this one but you could check the template for this:
                      <base href="[(site_url)]" />


                      Also check you .htaccess (this is mine)
                      RewriteEngine On
                      RewriteBase /modx/
                      
                      RewriteCond %{REQUEST_FILENAME} !-f
                      RewriteCond %{REQUEST_FILENAME} !-d
                      RewriteRule ^([^/]*)/?(.*)$ index.php?q=$1&d=$2 [L,QSA,NC]
                      


                      See if that helps.
                        BBloke

                      This discussion is closed to further replies. Keep calm and carry on.