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

    I enabled Friendly URLs. At first it did not work, until I put the following in my .htaccess file:

    RewriteEngine on
    RewriteRule ^(.*)$ /var/www/html/modx/index.php?q=$1 [L,QSA]


    However, when I go to http://www.mysite.com/modx/manager/ , instead of the manager interface I get the homepage...

    How can get the manager interface ’back’? Do I have to add an exception for the /manager/ folder and if so, how do you do that?

    (Edit) some clarification:
    I have a website at /var/www/html/ and a ’test’ environment for modx in /var/www/html/modx/

    For clarity and for search engines, I want to ’rewrite’ the URL’s under the directory /modx/ but not the webpages (and pages in subfolders) directly under / since there is an existing website there. Also, manager currently is at /var/www/html/modx/manager


      • 6562
      • 37 Posts
      Okay... I tried a long time, but I still cannot get this Friendly URLs to work... either it gives a Server 500 error, OR the resulting page in the ModX environment is always the homepage...
        • 25483
        • 741 Posts
        Did you try this:

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


        You have to place it in the "modx" folder
          with regards,

          Ronald Lokers
          'Front-end developer' @ h2o Media

          • 6562
          • 37 Posts
          Quote from: Ronald at Aug 12, 2008, 06:31 AM

          Did you try this:

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


          You have to place it in the "modx" folder

          Hi,

          yes apparently I was looking in the root folder, so the wrong folder! I did not know you could have several .htaccess files in a site...

          I changed the RewriteBase rule to point to the modx subdirectory, and it pretty much seems to work now.
            • 25483
            • 741 Posts
            Quote from: Darkelve78 at Aug 12, 2008, 06:38 AM

            Quote from: Ronald at Aug 12, 2008, 06:31 AM

            Did you try this:

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


            You have to place it in the "modx" folder

            Hi,

            yes apparently I was looking in the root folder, so the wrong folder! I did not know you could have several .htaccess files in a site...

            I changed the RewriteBase rule to point to the modx subdirectory, and it pretty much seems to work now.


            Yes, you can use .htaccess on every folder in a site. For example; in the manager folder of modx is also a .htaccess file to disable mod_rewrite on that folder wink
              with regards,

              Ronald Lokers
              'Front-end developer' @ h2o Media

              • 6562
              • 37 Posts
              I was also using friendly URLs with ’Use friendly alias path’ set to ’YES’. It worked for 1st-level pages but not for 2nd-level (pages having a ’parent’ and ’grandparent’ container)... until I added this:

              <base href="[(site_url)]" />


              Strangely, this only works if I put it RIGHT after <head> , does not work if I put it in another spot in <head>...</head>

              I found the exact answer on this forum, but still find it a bit strange/odd... x)