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

    I have MODX installed in a subfolder called beta, and I'm using a .htaccess file to point my domain to the beta folder.

    That part works great. When i type in mydomain.com it points to mydomain.com/beta but still shows mydomain.com in the address bar. Awesome.

    Friendly URLS work as well.

    My only issue is that when I actually type in mydomain.com/beta it does not show up as mydomain.com. It stays the way it is.

    Can anyone help me figure out how to totally remove the /beta folder from the address bar? I have been googling my butt off ,and I can't seem to find an answer.

    Here is my code in the root folder. I got rid of the .htaccess file in my beta folder hoping that would help, but it didn't.

    Thanks for any help!

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.com$
    RewriteCond %{REQUEST_URI} !^/beta
    RewriteRule ^(.*)$ beta/$1




    # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^mydomain\.com [NC]
    RewriteRule (.*) http://mydomain.com/$1 [R=301,L]



    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
      • 13226
      • 953 Posts
      If I understand correctly you have installed into a subfolder called "beta"

      Your "ht.access" file (the one in the beta folder) needs to be re-named to ".htaccess" and the "RewriteBase" needs to be modified as such:

      From
      RewriteBase /

      To
      RewriteBase /beta
        • 41480
        • 8 Posts
        Thanks so much for your reply. smiley Yes, the install is in a folder named "beta". Unfortunately, adding that to the .htaccess file didn't seem to change anything. I had an .htaccess file up and running in the beta folder at one point before I thought it might be the issue and got rid of it. That didn't help either. So, as of now the only thing in the "beta" folder's .htaccess file IS RewriteBase /beta.

        I moved the friendly URL code and the code to remove WWW to the root folder's .htaccess file.
          • 4172
          • 5,888 Posts
          the whole original .htaccess - code including the FURLs - stuff should stay under your subfolder /beta (where you have the MODX-installation) just with the modified RewriteBase

          The .htaccess in the main-folder should do the redirect of your Domain to /beta/ (if your hosting doesn't have another option for Domain-redirects to subfolders)

          I think its best to set all that up, before you run the MODX-setup under your new Domain, to get all pathes and urls configured correctly from the beginning.
          Running a MODX-upgrade could work, too.



            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 41480
            • 8 Posts
            Ahh ok. I will put the original file back in place in the subfolder then. I wasn't able to set that up from the beginning because it's replacing a site that's already up. I wanted in a test folder first. Thanks! smiley