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

    In installed the latest version of modx revolution however i have a strange issue. I was playing around with the .htaccess trying to get friendly urls to work and now when you go to the domain it displays like this www.domain.com/public_html/public_html/public_html/public_html/public_html/public_html/public_html/public_html/public_html/ and on and on

    Modx is installed in my root directory with the .htaccess above.

    Any ideas? I've posted the .htaccess below

    # Friendly URLs Part
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} .
    # Force all pages to go to www.mydomain.com for SEO
    RewriteCond %{HTTP_HOST} !^www\.DOMAINNAME\.TLD [NC]
    RewriteRule (.*) http://www.mydomain.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
      • 40392
      • 3 Posts
      For some reason it's adding a <a href=""> into the code...not sure why...this isnt actually in the .htaccess file
        • 3749
        • 24,544 Posts
        That's just the Forum software mangling your code. wink

        Here's some of the original code for reference (one extra space after the http to fool the Forum software). I don't see anything wrong with your code, but I'd try taking out the '# Force all pages' comment or moving it so it's not in the middle of a compound line.

        RewriteEngine On
        RewriteBase /
        
        
        
        #RewriteCond %{HTTP_HOST} .
        #RewriteCond %{HTTP_HOST} !^www\.example-domain-please-change\.com [NC]
        #RewriteRule (.*) http: //www.example-domain-please-change.com/$1 [R=301,L]
        
        
        # The Friendly URLs part
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
        



        ------------------------------------------------------------------------------------------
        PLEASE, PLEASE specify the version of MODX you are using.
        MODX info for everyone: http://bobsguides.com/modx.html
          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