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

    I've just recently started playing around with MODx (I'm on the latest release), and I'm absolutely loving it so far, but I ran into a weird problem pointed out (embarrassingly) by one of my clients. I installed MODx for my site, and my site only, but now all of my add-on sites redirect the url to a folder-like URL. Not sure if I'm making sense, so I'll just give the URL's. I visit my site, www.fletcherwebdesign.com, and everything is fine. When I visit any of my add-on domains, like www.asshadowscollapse.com, it changes the url to http://www.fletcherwebdesign.com/asshadowscollapse.com. The registered domains are still WORKING, but I don't want my clients to have to live with my site's URL attached to theirs. In the near future, I hope to use MODx on these add-on domains as well if that makes a difference, but their domain is their domain and it shouldn't have mine attached to it. How do I fix this problem?
      • 40029
      • 52 Posts
      looks like a salad domains smiley

      This is the classic look of an "add-on domain"

      the "add-on domain" can be redirected to this 3 ways:

      1) http:// firstsite.com/secondsite.com
      2) http:// secondsite.com.firstsite.com
      3) http:// secondsite.com

      may be that when you installed MODx on the second domain is made ​​by accessing the "add-on domain" with the actual domain of an "add-on domain"

      1) http:// firstsite.com/secondsite.com

      and now his MODx is configured with this directory, you can change system settings, under the name "site_url"

      if this does not change things, then ask your hosting provider to configure your panel correctly

      although, some hosting provider give free add-on service only allow the redirect mode 1 and 2

      Regards.
        Developer of RTOS and Drivers
        Specializes in portability of BSD/Linux
        • 40427
        • 16 Posts
        Thank you for the reply, but you've kinda lost me. Sorry. Maybe this will help clarify a bit: I've only installed MODx once, and it was for my primary domain. When I log in to my cPanel account, my add-on domains show up just like subdomains always have, which is as another folder in my public_html/ folder. The only difference between any add-on domain and subdomain is the .com appended to the folder name. Whether or not that helps at all, I'm not sure, but I thought I'd throw it on here just in case.

        Now, since I will eventually be using MODx (once I learn it) on my add-on domains, should I figure out how to manage these add-on domains from my one MODx account, or should I install MODx separately for each add-on (not that I have a limit, but I'm afraid of using up too much bandwidth if I do that)? And whatever that decision is, should I make that change now or later, once I'm comfortable with MODx. Furthermore, if I make that change now, will it affect my add-on domains' current pages (I don't want to configure them to MODx now, so can they just sit there under MODx without being re-coded FOR MODx)?

        I'm sorry for all the questions, but I'm looking for the correct answer for RIGHT now so my URLs are what they're supposed to be for my add-on domains while still leaving me my own website to tinker with in MODx. I guess that leads me to another question, whatever the answers to all the above questions are, will this actually fix my problem, or do I have to re-direct the URLs, and if so, how do I do that according to the correct next step to take? I know it's a lot to read, but I have no clue what my NEXT step should be.
          • 40427
          • 16 Posts
          And I kinda understand what you mean by the three forms now, and my hosting provider uses option 3; before my MODx install my add-on domains stayed as their domain name and didn't just add it to my domain name in some form. It's only since I've installed MODx that I've had this problem.
            • 40029
            • 52 Posts
            Quote from: smf1991 at Jul 10, 2012, 12:56 AM
            ... It's only since I've installed MODx that I've had this problem.

            uhm!,

            You can try to turn off "MODx" by renaming the file index.php
            and so you will see that is not related to your problem.

            I think you have overwritten files. htaccess on your server

            if you find it you could post here to see what is wrong.

            should be in the main root of its first and its second web site

            At any rate, I do not think the MODx installation may have caused this redirect

            Regards.
              Developer of RTOS and Drivers
              Specializes in portability of BSD/Linux
              • 40427
              • 16 Posts
              Now that you mention it, I did use my .htaccess to accept friendly URLs. Here's my current htaccess code (found on the internet, and it works):

              # Friendly URLs Part
              RewriteEngine On
              RewriteBase /
              RewriteCond %{HTTP_HOST} .
              # Force all pages to go to www.domain.com for SEO
              RewriteCond %{HTTP_HOST} !^www\.fletcherwebdesign\.com [NC]
              RewriteRule (.*) http://www.fletcherwebdesign.com/$1 [R=301,L]
              # Friendly URLs
              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteCond %{REQUEST_FILENAME} !-d
              RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
              # Additional Settings Follow
              ExpiresActive On
              ExpiresByType image/gif A2592000
              ExpiresByType image/jpeg A2592000
              ExpiresByType image/png A2592000
              BrowserMatch "MSIE" brokenvary=1
              BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
              BrowserMatch "Opera" !brokenvary
              SetEnvIf brokenvary 1 force-no-vary


              If this isn't the right way to do it, let me know!
                • 40427
                • 16 Posts
                And this code was pulled from this website: http://rtfm.modx.com/display/revolution20/Using+Friendly+URLs
                  • 40029
                  • 52 Posts
                  You see how it came out, that your redirection web was not due to the installation of MODx!

                  pasting this code at the end of your file should be able to redirect all traffic correctly.

                  ! assuming that the second web is in the directory asshadowscollapse.com !

                  RewriteEngine on
                  RewriteCond %{HTTP_HOST} ^www\.asshadowscollapse\.com$
                  RewriteRule ^ http:// www.fletcherwebdesign.com/asshadowscollapse.com%{REQUEST_URI} [L,P]
                  
                  


                  RewriteEngine on
                  RewriteCond %{HTTP_HOST} ^www\.asshadowscollapse\.com$
                  RewriteRule ^ http://www.fletcherwebdesign.com/asshadowscollapse.com%{REQUEST_URI} [L,P]

                  is also possible that the main root of the second web page, have a htaccess file, which may be related or not, with this problem and should consult with the hosting service provider.

                  In any case wanted to clarify something:
                  Apache directives contained within the file. htaccess have endless possibilities to customize your web traffic, this means that it can be easy and complicated at the same time make more rules are respected.
                   
                  You can not paste into this file, prove any code and anywhere, just because the code is in the official documentation of MODx, none can know that another type of redirect, this making your web server, and before applying any changes, you should analyze whether its modifications can cause the crash of other services. And you can not take the blame, the installation of MODx, or an example of MODx documentation in the case reported fulfills perfectly the proposed work in the same example.

                  this is my opinion, it is accepted or not, is just a personal opinion.

                  Regards.
                    Developer of RTOS and Drivers
                    Specializes in portability of BSD/Linux
                    • 10208 ☆ A M B ☆
                    • 1,780 Posts
                    smf1991 - This thread will be useful to help you configure the .htaccess at the root for your add on domains.

                    https://forums.modx.com/thread/73312/add-on-domain-and-htaccess-file-setting#dis-post-410056
                      Frogabog- MODX Websites in Portland Oregon
                      "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                      Having server issues? These guys have MODX Hosting perfected - SkyToaster
                      • 40427
                      • 16 Posts
                      OK, rtoskit, you're code, when saved, gave me some error and kept popping back up when I tried to edit my .htaccess in MODx, and when I visited my add-on as well as trying to log in to my MODx Manager, it threw a 500 error. But, thank you for giving me something to try!

                      Frogabog, I took the last post in this thread and tried to make it work (I posted it RIGHT under "RewriteBase /"), and I tried random variations, but it did absolutely nothing. Here are a few of the codes I tried:

                      RewriteRule ^(asshadowscollapse.com)($|/) - [L]

                      RewriteRule ^(http://www.asshadowscollapse.com)($|/) - [L]

                      RewriteRule ^(http://www.asshadowscollapse.com/)($|/) - [L]

                      RewriteRule ^(asshadowscollapse.com/)($|/) - [L]

                      RewriteRule ^(www\.asshadowscollapse\.com)($|/) - [L]

                      RewriteRule ^(http://www.fletcherwebdesign.com/asshadowscollapse.com/)($|/) - [L]


                      And probably a few others. I wasn't sure how exactly to put my domain in there, so I just tried everything I could think of.

                      So what should I try now?