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

    my revo-installation is within a folder called /cms/.

    Now, I use virtual hosts and rewrite rules to strip this directory from all urls entered. However, when I am logged into the manager and click onto a preview site I always get the urls with /cms/. Moreover, all the generated links have /cms/ in it.

    I changed the site_url for my context so that it disposes of the /cms/-thing. I do not know how MODx generates those links. Well, I know makeUrl, but I don't know how to influence that...

    Help is very much appreciated.

    Thanks
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      What do you mean exactly by using "rewrite rules to strip this directory from all urls entered"? It sounds like you might just have some trip-ups here with your Apache configuration.

      What's the document root for your site? E.g. http://yoursite.com/ resolves to /home/user/public_html/cms/ ?

      And what URL do you use to access the manager? e.g. http://yoursite.com/manager/ ? Or http://yoursite.com/cms/manager/ ?

      If you can get static pages resolving the way you want, then my guess is that MODX will follow suit.
        • 37582
        • 65 Posts
        I can access all my sites with http://mysite.com/cms/ as well as the manager under http://mysite.com/cms/manager/.

        It is fine to access the manager at this url, but it is horrible in terms of furls to have /cms/ in all urls. Therefore I use this rule to remove this from my urls:

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


        The directory I installed those things to is /some/path/document_root/cms/

        My biggest question is: Although I already changed my site_url setting to use http://mysite.com without /cms/, all generated links will still have cms in it. [ed. note: chrisissorry last edited this post 14 years, 10 months ago.]
          • 9207 ☆ A M B ☆
          • 2,475 Posts
          Yeah, I think maybe you should edit this in your VirtualHosts directive to use the /path/to/cms/ as your document root... that way you'd bypass all of this.

          If you can't make the change in the VirtualHosts, you have to update your .htaccess. I can't tell you exactly what you need to change in your rewrite rule, but there is a way to do this -- it usually takes me a while to figure out the necessary syntax.