• hello,
    I use the permalink structure /blog/%year%/%monthnum%/%day%/%post_id%-%postname%, and it works fine for links like:
    mysite.url/blog/2004/1/24/423-TitleOfThePost
    The specific RewriteRule for the permalink in the .htaccess is
    RewriteRule ^blog/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([0-9]+)?-([0-9a-z-]+)?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&day=$3&p=$4&name=$5&page=$6 [QSA]
    (I have the RewriteEngine On, and other rules too)
    But when I want to access to the monthly archives, the link is
    mysite.url/blog/2004/1/ (with the trailing slash), and it returns a 404 error… and its the same with urls like mysite.url/blog/2004/ or mysite.url/blog/2004/1/24/
    what can I do to access yearly, monthly and daily archives with this kind of URLs ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The dash between the post id and post name is probably screwing things up since it is not an optional match. Try adding a question mark after that dash. Like this:
    ?([0-9]+)?-?([0-9a-z-]+)?([0-9]+)?/?$
    That might mess up the title matching, however, since the title can have dashes. I don’t have time to think it through right now, but I’ll try it out when I return home in the evening. Let us know how it goes.

    Thread Starter beleg

    (@beleg)

    RewriteRule ^blog/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([0-9]+)?-?([0-9a-z-]+)?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&day=$3&p=$4&name=$5&page=$6 [QSA]
    it worked wit the question mark after the dash, thanks a lot !!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘404 on cruft URLs’ is closed to new replies.