• Hi all,
    I think my mod_rewrite rules for monthly archives are somehow messed up. I didn’t change anything, but they don’t work:
    https://iroke.de/wp/
    Since I can’t read the syntax, it would be very nice if somebody could either send me working rules and tell me which one of the following are responsible for the error:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wp/
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ – [S=43]
    RewriteRule ^(.*)/(..)/?$ /wordpress/$1/?cl_lang=$2 [QSA]
    RewriteRule ^(..)/?$ /wordpress/?cl_lang=$1 [QSA]
    RewriteRule ^(contact)/trackback/?$ /wp/index.php?pagename=$1&tb=1 [QSA,L]
    RewriteRule ^(contact)/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?pagename=$1&feed=$2 [QSA,L]
    RewriteRule ^(contact)/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?pagename=$1&feed=$2 [QSA,L]
    RewriteRule ^(contact)/page/?([0-9]{1,})/?$ /wp/index.php?pagename=$1&paged=$2 [QSA,L]
    RewriteRule ^(contact)(/[0-9]+)?/?$ /wp/index.php?pagename=$1&page=$2 [QSA,L]
    RewriteRule ^feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?&feed=$1 [QSA,L]
    RewriteRule ^(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?&feed=$1 [QSA,L]
    RewriteRule ^page/?([0-9]{1,})/?$ /wp/index.php?&paged=$1 [QSA,L]
    RewriteRule ^comments/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?&feed=$1&withcomments=1 [QSA,L]
    RewriteRule ^comments/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?&feed=$1&withcomments=1 [QSA,L]
    RewriteRule ^comments/page/?([0-9]{1,})/?$ /wp/index.php?&paged=$1 [QSA,L]
    RewriteRule ^search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?s=$1&feed=$2 [QSA,L]
    RewriteRule ^search/(.+)/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?s=$1&feed=$2 [QSA,L]
    RewriteRule ^search/(.+)/page/?([0-9]{1,})/?$ /wp/index.php?s=$1&paged=$2 [QSA,L]
    RewriteRule ^search/(.+)/?$ /wp/index.php?s=$1 [QSA,L]
    RewriteRule ^category/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?category_name=$1&feed=$2 [QSA,L]
    RewriteRule ^category/(.+)/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?category_name=$1&feed=$2 [QSA,L]
    RewriteRule ^category/(.+)/page/?([0-9]{1,})/?$ /wp/index.php?category_name=$1&paged=$2 [QSA,L]
    RewriteRule ^category/(.+)/?$ /wp/index.php?category_name=$1 [QSA,L]
    RewriteRule ^author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?author_name=$1&feed=$2 [QSA,L]
    RewriteRule ^author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?author_name=$1&feed=$2 [QSA,L]
    RewriteRule ^author/([^/]+)/page/?([0-9]{1,})/?$ /wp/index.php?author_name=$1&paged=$2 [QSA,L]
    RewriteRule ^author/([^/]+)/?$ /wp/index.php?author_name=$1 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?year=$1&monthnum=$2&day=$3&feed=$4 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?year=$1&monthnum=$2&day=$3&feed=$4 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$ /wp/index.php?year=$1&monthnum=$2&day=$3&paged=$4 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /wp/index.php?year=$1&monthnum=$2&day=$3 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?year=$1&monthnum=$2&feed=$3 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?year=$1&monthnum=$2&feed=$3 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$ /wp/index.php?year=$1&monthnum=$2&paged=$3 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/?$ /wp/index.php?year=$1&monthnum=$2 [QSA,L]
    RewriteRule ^([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?year=$1&feed=$2 [QSA,L]
    RewriteRule ^([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?year=$1&feed=$2 [QSA,L]
    RewriteRule ^([0-9]{4})/page/?([0-9]{1,})/?$ /wp/index.php?year=$1&paged=$2 [QSA,L]
    RewriteRule ^([0-9]{4})/?$ /wp/index.php?year=$1 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([^/]+)/trackback/?$ /wp/index.php?year=$1&monthnum=$2&name=$3&tb=1 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?year=$1&monthnum=$2&name=$3&feed=$4 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?year=$1&monthnum=$2&name=$3&feed=$4 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([^/]+)/page/?([0-9]{1,})/?$ /wp/index.php?year=$1&monthnum=$2&name=$3&paged=$4 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$ /wp/index.php?year=$1&monthnum=$2&name=$3&page=$4 [QSA,L]
    RewriteRule ^index.php/feed/(feed|rdf|rss|rss2|atom)/([0-9,]+)/?$ /wp/index.php?&feed=$matches[1]&cat=$matches[2] [QSA,L]
    RewriteRule ^index.php/(feed|rdf|rss|rss2|atom)/([0-9,]+)/?$ /wp/index.php?&feed=$matches[1]&cat=$matches[2] [QSA,L]
    </IfModule>

    # END WordPress

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is your monthly archive rule:
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/?$ /wp/index.php?year=$1&monthnum=$2 [QSA,L]

    Manually specifying the year and month works:
    https://iroke.de/wp/index.php?year=2005&monthnum=7

    My guess is that this rule, at the top of your list, is causing trouble:
    RewriteRule ^(.*)/(..)/?$ /wordpress/$1/?cl_lang=$2 [QSA]

    That says zero or more characters, followed by a slash and exactly two characters, followed by an optional slash …

    Can you comment that bit out, and see if it works?

    Thread Starter grendels

    (@grendels)

    I did – the archive seems to work now, thank you very much ??
    What was the reason for that rule
    RewriteRule ^(.*)/(..)/?$ /wordpress/$1/?cl_lang=$2 [QSA]
    to be inserted in the htaccess in the first place? I mean, if the devs decided to leave it in there, I guess it served a purpose…?

    Looks like there’s a glitch in the templating system, but I’ll see to iron that out then I’ll be glad to move over from blogger ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘correct mod_rewrite rules for monthly archives?’ is closed to new replies.