• Hey

    I think you have these lines the wrong way around

    # check permalink structure has trailing slash
    RewriteCond %{REQUEST_URI} /[^\./\?]+(\?.*)?$
    
    # check permalink structure has no trailing slash
    # RewriteCond %{REQUEST_URI} /[^\./\?]+/(\?.*)?$

    And for nginx

    # check permalink structure has trailing slash
            if ( $request_uri !~ /[^\./\?]+(\?.*)?$ ) {
                return 405;
            }
            # check permalink structure has no trailing slash
            # if ( $request_uri !~ /[^\./\?]+/(\?.*)?$ ) {
            #    return 405;
            # }

    `

    Also, in Apache 2.4 at least, the use of environment variables inside of environment variables doesn’t seem to work – they are treated as literals.

    Jamie.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter jamieburchell

    (@jamieburchell)

    You can use this approach to fix this:

    Fix empty env variables returning the number “1”:

    # default cache keys
    RewriteRule ^ - "[E=CE_CACHE_KEY_SCHEME:https-]"
    RewriteRule ^ - "[E=CE_CACHE_KEY_DEVICE:]"
    RewriteRule ^ - "[E=CE_CACHE_KEY_WEBP:]"
    RewriteRule ^ - "[E=CE_CACHE_KEY_COMPRESSION:]"
    

    Fix env variables being interpreted as literal strings:

    # get cache file
    RewriteRule ^ - "[E=CE_CACHE_FILE_DIR:%{ENV:CE_CACHE_DIR}/%{HTTP_HOST}%{REQUEST_URI}]"
    RewriteRule ^ - "[E=CE_CACHE_FILE_NAME:%{ENV:CE_CACHE_KEY_SCHEME}index%{ENV:CE_CACHE_KEY_DEVICE}%{ENV:CE_CACHE_KEY_WEBP}.html%{ENV:CE_CACHE_KEY_COMPRESSION}]"
    RewriteRule ^ - "[E=CE_CACHE_FILE:%{ENV:CE_CACHE_FILE_DIR}/%{ENV:CE_CACHE_FILE_NAME}]"
    

    Your slash/trailing slash examples are the wrong way around. The trailing slash code doesn’t match the root/homepage for me, so I’m removing that check anyway.

    Jamie

    • This reply was modified 2 years, 6 months ago by jamieburchell.
Viewing 1 replies (of 1 total)
  • The topic ‘Issues with advanced Apache config docs’ is closed to new replies.