Support » Fixing WordPress » Year archive pulling up archives.php page

  • Nick Momrik

    (@mtdewvirus)


    Ok,
    I’m drawing a blank on this one. For some reason, my year archives, such as http://mtdewvirus.com/archives/2005/ are not using archive.php as it should. Instead, WP is pulling up my archives.php page which should only be accessed with http://mtdewvirus.com/archives/.

    I’m clueless right now. I’ve looked through my rewrite rules, removed all my custom rewrite stuff. Still no luck.

    Anybody have any ideas?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Nick Momrik

    (@mtdewvirus)

    I delete the “archives page” in my admin, but leaft archives.php in the theme. When I do this, year archives work as they should by using archive.php.

    Very odd and confusing…

    Nick Momrik

    (@mtdewvirus)

    Found it!

    Since I had a “page” with a slug of “archives”, this is part of the rewrite code that was generated for it.

    RewriteRule ^(archives)/?([0-9]+)?/?$ /index.php?pagename=$1&page=$2 [QSA,L]

    So anything with “archives/#####/” (any number of digits 0-9 where those # symbols are) was being directed to use the “archives page”.

    Guess I won’t be letting WP manage my .htaccess file. :-/

    So how u fix it? I’m having the same problem too, mind tell me? Thanks

    Change this rule…
    RewriteRule ^(archives)/?([0-9]+)?/?$ /index.php?pagename=$1&page=$2 [QSA,L]
    to this…
    RewriteRule ^(archives)/?$ /index.php?pagename=$1 [QSA,L]

    If you’re to change this and then let WP go back to handling the .htaccess file, it’ll just rewrite your changes right? Cause it’s really a ton easier to let WP just handle the file instead of manually updating it when you add a new page.

    Yes, if you let WP handle .htaccess, it’s going to keep adding the rules back in.

    I too have tried testing it for my blog but it gives it for only a month and not for a year. Can any of u guide me over it. Like how to make changes in Archive.php and make it running

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Year archive pulling up archives.php page’ is closed to new replies.