We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30086
    • 110 Posts
    hi
    i’m quite confused with the statement here:
    It says, after devoloping the site locally make a copy of .htaccess. Which ".htaccess" this one for now? Is this under /manager/.htaccess
    or is this the one under /yourfolder/.htaccess



    Don’t forget to rename or copy the ht.access file to .htaccess in the /manager folder to turn off the RewriteEngine for that folder.
    # After developing the site locally (using all relative paths from the site root, to keep it portable), make a copy of .htaccess and call it .htaccess.local, editing the RewriteBase in the .htaccess file for the remote deployment location as appropriate (usually removing the subdirectory path, just leaving the /). The .htaccess file in /manager should be left as it is.
    # Then make a copy of manager/includes/config.inc.php as config.local.inc.php, and edit config.inc.php with the remote database connection settings for the deployment server (the remote db must be already created and ready to use; make sure it’s created with the proper character set and collation defaults).
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The .htaccess file in /manager should be left as it is
      However, in the more recent versions of MODx that /manager .htaccess file isn’t even necessary, as there is a rewrite rule in the main one to ignore requests from the /manager directory. So the rewrite rules aren’t applied to the manager pages anyway.
        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
        • 30086
        • 110 Posts
        what does it mean?
        i should just leave it like that? i mean i only concentrate on the .htaccess of "/assets" is that correct?

          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Ok, we’re making a tempest in a teapot here. The whole point is, if your MODx is installed in a subdirectory, the RewriteBase needs to say so:
          RewriteBase /subdir-name

          If it is in the web root, then it needs to be just plain /.

          I suggested making a copy and editing the copy just to keep things safe; in case of a problem the original would still be there to fall back to.
            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
            • 30086
            • 110 Posts
            ok thanks i saw that the Rewrite Base is just with plain "/"

            how about this:

            # For Friendly URLs
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ testwikima/index.php?q=$1 [L,QSA]


            I added the name of the folder where i installed the Modx is this correct?

            If you say that if it’s in the webroot then I leave it like that,
            but what if I have this
            c:\xampp\htdocs\test

            do i need to copy this directory path to the Rewrite Base?

            Is this correct?
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Here is what your htaccess should look like; if MODx is installed in a subdirectory the RewriteBase should have the subdirectory name:
              # For full documentation and other suggested options, please see
              # http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions
              # including for unexpected logouts in multi-server/cloud environments
              # and especially for the first three commented out rules
              
              #php_flag register_globals Off
              #AddDefaultCharset utf-8
              #php_value date.timezone Europe/Moscow
              
              Options +FollowSymlinks
              RewriteEngine On
              RewriteBase /
              
              # Fix Apache internal dummy connections from breaking [(site_url)] cache
              RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
              RewriteRule .* - [F,L]
              
              # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
              #RewriteCond %{HTTP_HOST} .
              #RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
              #RewriteRule (.*) http://www.example.com/$1 [R=301,L]
              
              # Exclude /assets and /manager directories and images from rewrite rules
              RewriteRule ^(manager|assets)/*$ - [L]
              RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L]
              
              # For Friendly URLs
              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteCond %{REQUEST_FILENAME} !-d
              RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
              
              # Reduce server overhead by enabling output compression if supported.
              #php_flag zlib.output_compression On
              #php_value zlib.output_compression_level 5
                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