WordPress.org

Ready to get started?Download WordPress

Forums

How permalinks and archive work (2 posts)

  1. gpaciga
    Member
    Posted 7 years ago #

    I'm trying to set up a link structure like the one wordpress has for archives and permalinks and I'd like some help understanding it.

    I noticed when playing with my .htaccess file that it doesn't hold the rules for rewriting a URI like /2006/07/ to some archive page, it's all handled internally in index.php. How does index.php get the information about what page it should display from the URI? Is it all just looking at substrings of PHP_SELF? I saw a few instances of this in the code but haven't really figured it all out yet.

  2. Christopher J. Hradil
    Member
    Posted 7 years ago #

    as long as you have your .htaccess file configured via your permalinks options in the wp admin panel, all should work as expected. for the /2006/07 type URI's, just choose the default date/name based permalinks from your admin panel.

    as far as digging in a little deeper to see how it works, yes, all of the re-writing is handled by the wordpress code, not the .htaccess file.

    wp uses apache's mod_rewrite, much of the actual magic happens in wp-includes/classes.php and wp-includes/template-functions-links.php

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags