WordPress.org

Ready to get started?Download WordPress

Forums

Year archive pulling up archives.php page (8 posts)

  1. Nick Momrik
    Member
    Posted 9 years ago #

    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?

  2. Nick Momrik
    Member
    Posted 9 years ago #

    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...

  3. Nick Momrik
    Member
    Posted 9 years ago #

    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. :-/

  4. jimtkm
    Member
    Posted 9 years ago #

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

  5. Nick Momrik
    Member
    Posted 9 years ago #

    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]

  6. lawtai
    Member
    Posted 9 years ago #

    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.

  7. Nick Momrik
    Member
    Posted 9 years ago #

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

  8. cheriyan
    Member
    Posted 8 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.