最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

404 error - Page not found if mod_cache_disk is active

programmeradmin0浏览0评论

I set in Apache the mod_cache_disk module, but I'm getting 404 page not found error on every page and posts. I'm using WordPress Multisite on Debian 10 server with PHP FPM 7.4.

I set this below in apache2.conf file:

<IfModule mod_cache.c>
    CacheQuickHandler off

    CacheIgnoreNoLastMod On
    CacheDefaultExpire 7200

    CacheIgnoreCacheControl On
    CacheLastModifiedFactor 0.5
    CacheIgnoreHeaders Set-Cookie Cookie
    CacheHeader on
    CacheLock on
    CacheDisable /wp-admin
    CacheDisable /wp-login.php
    CacheDisable /wp-cron.php

    SetOutputFilter CACHE
    AddOutputFilterByType DEFLATE text/html text/plain text/css application/javascript application/rss+xml text/xml image/svg+xml

    <IfModule mod_cache_disk.c>
        CacheRoot /mnt/cache
        CacheEnable disk /
        CacheDirLevels 2
        CacheDirLength 1
        CacheMaxFileSize 100000000
    </IfModule>
</IfModule>

Everything is working fine if I delete these lines from the configuration file.

How can I fix this issue? I would like to use mod_cache_disk with WordPress, it makes it at least 35x faster.

I set in Apache the mod_cache_disk module, but I'm getting 404 page not found error on every page and posts. I'm using WordPress Multisite on Debian 10 server with PHP FPM 7.4.

I set this below in apache2.conf file:

<IfModule mod_cache.c>
    CacheQuickHandler off

    CacheIgnoreNoLastMod On
    CacheDefaultExpire 7200

    CacheIgnoreCacheControl On
    CacheLastModifiedFactor 0.5
    CacheIgnoreHeaders Set-Cookie Cookie
    CacheHeader on
    CacheLock on
    CacheDisable /wp-admin
    CacheDisable /wp-login.php
    CacheDisable /wp-cron.php

    SetOutputFilter CACHE
    AddOutputFilterByType DEFLATE text/html text/plain text/css application/javascript application/rss+xml text/xml image/svg+xml

    <IfModule mod_cache_disk.c>
        CacheRoot /mnt/cache
        CacheEnable disk /
        CacheDirLevels 2
        CacheDirLength 1
        CacheMaxFileSize 100000000
    </IfModule>
</IfModule>

Everything is working fine if I delete these lines from the configuration file.

How can I fix this issue? I would like to use mod_cache_disk with WordPress, it makes it at least 35x faster.

Share Improve this question asked May 31, 2020 at 11:39 FerimanFeriman 2892 silver badges9 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I solved this issue by replacing

RewriteRule . /index.php [L]

with

RewriteRule ^(.*)$ /index.php/$1 [L]

in .htaccess file.

发布评论

评论列表(0)

  1. 暂无评论