We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    What is the Rewrite Base line in the .htaccess?

    Try renaming the ht.access file in the manager folder to .htaccess and turning the RewriteEngine back on in the main .htaccess file.

    Did the host use the MODX .htaccess file or is it their own. If it's not the MODX one, you won't be able to use Friendly URLs.

    Also, in the main MODX .htaccess file, there should be two sections that force www or non-www URLs. Uncomment *one* of them. Getting logged out is often caused by a link that takes you from a www domain to a non-www domain, or vice versa. That loses the session data that lets you stay logged in from page to page.
      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
      • 48696
      • 41 Posts
      Thanks for reply Bob, not necessary using friendly urls on that install, only what I tried unsuccessful is accessible manager.

      On hosting are two domains in folder /www/domains/, domain with MODX 2.5 has path /www/domains/DOMAINWITHMODX.cz/modx-2.5.0-pl/

      Normaly I'm using .htaccess on ../modx-2.5.0-pl to remove modx folder after domain url which works on my server, but on that hosting it didnt work, i communicate with them and they solved with

      /www/.htaccess
      RewriteEngine On
      
      RewriteCond %{HTTP_HOST} ^(www\.)?DOMAINWITHMODX\.cz$
      RewriteCond %{REQUEST_URI} !^modx-2\.5\.0-pl/
      RewriteCond %{REQUEST_URI} !^/modx-2\.5\.0-pl/
      RewriteCond %{REQUEST_URI} !^domains/DOMAINWITHMODX\.cz/modx-2\.5\.0-pl/
      RewriteCond %{REQUEST_URI} !^/domains/DOMAINWITHMODX\.cz/modx-2\.5\.0-pl/
      RewriteRule (.*) /domains/DOMAINWITHMODX.cz/modx-2.5.0-pl/$1 [L]
      
      # whole domains (aliases)
      RewriteCond %{REQUEST_URI} !^domains/
      RewriteCond %{REQUEST_URI} !^/domains/
      RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$
      RewriteCond %{DOCUMENT_ROOT}/domains/%2 -d
      RewriteRule (.*) domains/%2/$1 [DPI]
      
      # subdomains (www or non-www)
      RewriteCond %{REQUEST_URI} !^subdom/
      RewriteCond %{REQUEST_URI} !^/subdom/
      RewriteCond %{HTTP_HOST} ^(www\.)?(.*)\.([^\.]*)\.([^\.]*)$
      RewriteCond %{DOCUMENT_ROOT}/subdom/%2 -d
      RewriteRule (.*) subdom/%2/$1 [DPI]
      
      # aliases - redirect with absent /
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^domains/[^/]+/(.+[^/])$ /$1/ [R]
      
      # subdomains - redirect with absent /
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^subdom/[^/]+/(.+[^/])$ /$1/ [R]
      
      

      /www/domains/DOMAINWITHMODX.cz/modx-2.5.0-pl/.htaccess

      RewriteEngine On
      
      RewriteCond %{THE_REQUEST} \s/?modx-2.5.0-pl
      RewriteRule (.*) http://www.DOMAINWITHMODX.cz/$1 [R=301,L]
      
      

      After turn off RewriteEngine it logs in (but no sidebar shown and manager is unlogging me after click on menu)

      /www/domains/DOMAINWITHMODX.cz/modx-2.5.0-pl/manager/.htaccess

      RewriteEngine Off



      core/config/config.inc.php

      if (!defined('MODX_MANAGER_PATH')) {
      $modx_manager_path= '/data/web/virtuals/46703/virtual/www/domains/DOMAINWITHMODX.cz/modx-2.5.0-pl/manager/';
      // $modx_manager_url= '/domains/DOMAINWITHMODX.cz/modx-2.5.0-pl/manager/';
      // change for login to manager
      $modx_manager_url= '/modx-2.5.0-pl/manager/';
      define('MODX_MANAGER_PATH', $modx_manager_path);
      define('MODX_MANAGER_URL', $modx_manager_url);
      }

      I've tried turn on/off rewrite engine in manager/.htaccess changing paths in config.inc.php but no way, I'm so confused...



      • discuss.answer
        • 3749
        • 24,544 Posts
        I think part of your problem may be that you've unzipped the MODX file in the root directory of your site, which puts all the files one level down (in modx-2.5.0-pl).

        You shouldn't really have a modx-2.5.0-pl directory at all -- it will make things more complicated when you upgrade, since if you do the same thing again, you'll have a modx-2.5.1-pl directory and none of your own files will be there. The files in that modx-2.5.0-pl directory should be in the '/data/web/virtuals/46703/virtual/www/domains/DOMAINWITHMODX.cz/ directory.

        In addition, you really should have a Rewrite Base line in the .htaccess in the root.

        Do you really have a directory that ends in ".cz" ? For example, bobsguides.com is part of the URL for my site, but the path is just bobsguides.

        Since it's a new install, I would start over. Rename the .htaccess file in the root, delete everything else, empty the DB, and use Susan Sottwell's script to install MODX. At least then you'll have everything in the right place.
          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
          • 48696
          • 41 Posts
          Hi Bob, at first, thank for reply. Now I've tried it once again on another web and after long day I moved modx installation to root, so this works perfect smiley