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

    my modx .htaccess is destroying another .htacces in an internal directory (a wiki)...
    any idea how to avoid this? sad

    disabling friendly urls is the only way to go?


    regards, and sorry for the bad english smiley

    luciano
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      What’s the url of the site vs. the url of the wiki? If you have your wiki in a sub-domain, it should work.

      What’s the .htaccess file of the MODx site vs. the .htaccess file of the wiki?
        • 17705
        • 501 Posts
        mmmmmm, interesting... but in my server subdomains are in fact sub directories, if I am not wrong...
        and the main .htaccess (at public_html) will prevail over the wiki subdirectory...


        this is the modx .htacces:

        # For full documentation and other suggested options, please see
        # http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions
        # including for unexpected logouts in multi-server/cloud environments
        
        Options +FollowSymlinks
        RewriteEngine On
        RewriteBase /
        
        # Fix Apache internal dummy connections from breaking [(site_url)] cache
        RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
        RewriteRule .* - [F,L]
        
        # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
        #RewriteCond %{HTTP_HOST} .
        #RewriteCond %{HTTP_HOST} !^example\.com [NC]
        #RewriteRule (.*) http://example.com/$1 [R=301,L]
        
        # Exclude /assets and /manager directories from rewrite rules
        RewriteRule ^(manager|assets) - [L]
        
        # For Friendly URLs
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
        
        # Reduce server overhead by enabling output compression if supported.
        #php_flag zlib.output_compression On
        #php_value zlib.output_compression_level 5
        



        and this is the wiki .htaccess:

        ### STOP REFERRER SPAM
        SetEnvIfNoCase Referer ".*(adultsite|picturesplace|learnthebiz|pi-o|erotica|ghettoinc|port5|bulk-email|camgirls|paris-hilton|modelos|kredit|handyflirt24|versicherung|wwww|erotower|krank|x-1000|flirtnet|blowjob|agedwife|in-the-vip|boysfirsttime|milf|captain-stabbin|tranny|Kontakt|erotik|fetish|frauen|hardcore|fick|krankenversicherung|jinnan-cross|8thstreet|xxx|XXX|ficken|fuck).*" BadReferrer
        
        order deny,allow
        deny from env=BadReferrer
        
        <IfModule mod_rewrite.c>
        	# turn on rewrite engine
        	RewriteEngine on
        RewriteBase /librecultivo
        	# if request is a directory, make sure it ends with a slash
        	RewriteCond %{REQUEST_FILENAME} -d
        	RewriteRule ^(.*/[^/]+)$ $1/
        
        	# if not rewritten before, AND requested file is wikka.php
        	# turn request into a query for a default (unspecified) page
        	RewriteCond %{QUERY_STRING} !wakka=
        	RewriteCond %{REQUEST_FILENAME} wikka.php
        	RewriteRule ^(.*)$ wikka.php?wakka= [QSA,L]
        
        	# if not rewritten before, AND requested file is a page name
        	# turn request into a query for that page name for wikka.php
        	RewriteCond %{QUERY_STRING} !wakka=
        	RewriteRule ^(.*)$ wikka.php?wakka=$1 [QSA,L]
        </IfModule>
          • 9207 ☆ A M B ☆
          • 2,475 Posts
          Ack... sorry. Sub DOMAINS. Not sub directories. I need to see your file and folder hierarchy so I know where each file is. Often sub domains are in completely different folders. Is it something like:

          public_html/ -- ROOT of my MODx Install
             +-- .htaccess (main one)
             +-- wiki_doc_root/
                +--- .htaccess (wiki)
          

          Or something different?
            • 17705
            • 501 Posts
            yep, the hierarchy is like that smiley

            you say that making /wiki_root a subdomain it will work?