WordPress.org

Support

Support » How-To and Troubleshooting » Year archive pulling up archives.php page

Year archive pulling up archives.php page

Viewing 7 replies - 1 through 7 (of 7 total)
  • 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…

    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.

    cheriyan
    Member

    @cheriyan

    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.