• Hi there,

    I’m serving my plugins and the remaining content from two different subdomains.

    static1.mydomain.com for plugins only, static2.mydomain.com for all other folders of wp-content.

    Means: Cachify as a plugin is stored on static1, the cache folder of Cachify on static2.

    With this constellation I’m wondering how the statements for the htaccess have to like if I would look like with HDD mode.

    Could your please help?

    Thanks
    Carsten

    • This topic was modified 7 years, 10 months ago by justyumyum.
    • This topic was modified 7 years, 10 months ago by justyumyum.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The URLs are not necessary for the .htaccess file.

    You need the local path of your server to wp-content in the .htaccess file.
    You can take a look into your wp-config.php if you don’t know the exact paths.

    If you need some further help please let me know

    An updated version with some config hints inside the plugin is planned which will try to specify the paths directly

    https://github.com/pluginkollektiv/cachify/pull/69

    Thread Starter justyumyum

    (@justyumyum)

    So, if I got you right, the statements for Cachify in the htaccess should lokk like this?

    # BEGINN CACHIFY
    
        # ENGINE ON
        RewriteEngine On
    
        # GZIP FILE
        
            RewriteCond %{REQUEST_URI} /$
            RewriteCond %{REQUEST_URI} !^/wp-admin/.*
            RewriteCond %{REQUEST_METHOD} !=POST
            RewriteCond %{QUERY_STRING} =""
            RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
            RewriteCond %{HTTP:Accept-Encoding} gzip
            RewriteCond home/www/static1.mydomain.de/wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html.gz -f
            RewriteRule ^(.*) /cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html.gz [L]
    
            AddType text/html .gz
            AddEncoding gzip .gz
        
    
        # HTML FILE
        RewriteCond %{REQUEST_URI} /$
        RewriteCond %{REQUEST_URI} !^/wp-admin/.*
        RewriteCond %{REQUEST_METHOD} !=POST
        RewriteCond %{QUERY_STRING} =""
        RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
        RewriteCond home/www/static1.mydomain.de/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html -f
        RewriteRule ^(.*) /cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html [L]
    
    # END CACHIFY

    dont know your paths on the server but i think it should be:

    http only:

    
    # BEGINN CACHIFY
    <IfModule mod_rewrite.c>
        # ENGINE ON
        RewriteEngine On
    
        # GZIP FILE
        <IfModule mod_mime.c>
            RewriteCond %{REQUEST_URI} /$
            RewriteCond %{REQUEST_URI} !^/(wp-admin|wp-content/cache)/.*
            RewriteCond %{REQUEST_METHOD} !=POST
            RewriteCond %{QUERY_STRING} =""
            RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
            RewriteCond %{HTTP:Accept-Encoding} gzip
            RewriteCond home/www/static1.mydomain.de/wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html.gz -f
            RewriteRule ^(.*) /wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html.gz [L]
    
            AddType text/html .gz
            AddEncoding gzip .gz
        </IfModule>
    
        # HTML FILE
        RewriteCond %{REQUEST_URI} /$
        RewriteCond %{REQUEST_URI} !^/(wp-admin|wp-content/cache)/.*
        RewriteCond %{REQUEST_METHOD} !=POST
        RewriteCond %{QUERY_STRING} =""
        RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
        RewriteCond home/www/static1.mydomain.de/wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html -f
        RewriteRule ^(.*) /wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html [L]
    </IfModule>
    # END CACHIFY
    

    https only:
    if the website is only accessible via SSL/TLS, you have to edit /wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html
    to
    /wp-content/cache/cachify/https-%{HTTP_HOST}%{REQUEST_URI}index.html

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘htaccess rules for caching on subdomains’ is closed to new replies.