FREE THOUGHT · FREE SOFTWARE · FREE WORLD

WordPress .htaccess in-depth

WordPress PermalinksWordPress uses a file named .htaccess to rewrite all requests to the main index.php file (using the php WordPress Rewrite API). This article explains what the htaccess file rules look like and what they actually do.

Htaccess Definitions

Before we get started, we need to define some htaccess terms and code. The big ones are RewriteCond and RewriteRule.

Container for directives based on existance of specified modules
REQUEST_FILENAME
The full local filesystem path to the file or script matching the request.
RewriteEngine
enables or disables the runtime rewriting engine.
RewriteBase
specifies the URL prefix to be used for per-directory (htaccess) RewriteRule directives that substitute a relative path
RewriteCond
defines a rule condition. One or more RewriteCond can precede a RewriteRule directive. The following rule is then only used if both the current state of the URI matches its pattern, and if these conditions are met.
RewriteRule
an URL-applied regexp-pattern and a substitution URL

WordPress Default Htaccess

If you turn on pretty urls by using permalinks this is the default .htaccess file created.

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


# END WordPress

Lets look at this line by line.

  1. # BEGIN WordPress - Comment indicating start of WordPress generated htaccess
  2. - Runs the code only if the mod_rewrite.c module is loaded in Apache
  3. RewriteEngine On - Turns on the mod_rewrite engine
  4. RewriteBase / - Sets the base for rewrites to /
  5. RewriteRule ^index.php$ - [L] - Do NOT do anything for a request to exactly index.php
  6. RewriteCond %{REQUEST_FILENAME} !-f If the requested filename is not an existing file (-f is regular file), continue processing
  7. RewriteCond %{REQUEST_FILENAME} !-d If the requested filename is not an existing directory (-d is directory), continue processing
  8. RewriteRule . /index.php [L] - Rewrite any request to /index.php
  9. - End of IfModule block
  10. # END WordPress - End of WordPress generated htaccess

Ok, so perhaps you're wondering where the #BEGIN WordPress and #END WordPress lines are at.... Well, the answer is in the wp-admin/includes/misc.php file's save_mod_rewrite_rules() function and it's call to insert_with_markers() (which saves the .htaccess file with the "markers").

WPMU Default Htaccess

Here is the .htaccess file if using WordPress Multi-User.

Without subdomain installs

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(.*.php)$ $1 [L]
RewriteRule . index.php [L]


# END WordPress

With Subdomains

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]


# END WordPress

WordPress php

save_mod_rewrite_rules() - Updates the htaccess file with the current rules if it is writable. Grabs the htaccess contents from the $wp_rewrite class, then inserts the contents with the # BEGIN/END WordPress lines

Role of WP_Rewrite

WP_Rewrite is WordPress' class for managing the rewrite rules that allow you to use Pretty Permalinks feature. It has several methods that generate the rewrite rules from values in the database. It is used internally when updating the rewrite rules, and also to find the URL of a specific post, Page, category archive, etc.. It's defined in wp-includes/rewrite.php as a single instance global variable, $wp_rewrite, is initialised in wp-settings.php.

Actually, I think this deserves a bit more discussion... Let's consider a permalink like %category%/%postname%.

So you're handed a URL like /mycat/mypost. You start by parsing it into mycat and mypost. You don't know what these are. They're just strings to you. So, first, you have to consider what "mycat" is.

First, you query to see if "mycat" is a pagename. This is a select from wp_posts where post_slug = mycat and post_type = page. No joy there.

Next, you query to see if "mycat" is a category. This is a select from wp_terms join wp_term_taxonomy on (term_id = term_id) where term = mycat and taxonomy = category. Hey, we found a mycat, so that's good. Unfortunately, this just tells us that it's a category, which is rather useless in retrieving the actual post we're looking for. So we ignore the category.

Now, we move on to the "mypost". Again, we start querying: 1. Is it a page? select from wp_posts where post_slug = mypost and post_type = page. Nope. 2. Is it a category? select from wp_terms join wp_term_taxonomy on (term_id = term_id) where term = mypost and taxonomy = category. Nope. 3. Is it a post? select from wp_posts where post_slug = mypost and post_type = post. Bingo.

The whole goal is to determine the specific post being asked for. The category is not helpful in this respect, and we have to do a couple queries just to figure out that we need to ignore it. Five queries to determine what the post is with this structure. Five queries, two of them expensive (joins ain't cheap). And these have to happen on every load of a post on your site.

With the pre-built list of rewrite rules, we already have the data in memory, in a big array. All that need be done with the current case is an array lookup on the url. And the query to get that list was one simple one, just get the rewrite_rules option. In fact, most all the options are preloaded with one big query at the beginning load anyway, so it's a no-query operation.

The only reason you're running 2400 queries is because your rewrite_rules are not being saved in the first place. Now, I grant you that 2400 queries is a heck of a lot to build the rewrite rule list in the first place, and no doubt some optimization can be done there, but if that data was saved properly when you built the rewrite rules, then the pre-calculation saves time and queries and makes it much faster. The only reason it's not working is that the data isn't being saved.

It's certainly possible to conceive of an alternate strategy. What if we stored all the rewrite rules in a separate table? Now we can pull from that table as needed, and each row is quite small by comparison. This would certainly work for this specific case, but it makes other cases require more queries. Since now we don't have them in memory any more, we have to pull a new row for each different rewrite case.

There's no particularly good all-around solution, unless you want to precalculate every possible URL and store them in a separate table with that URL as the index. Then it's one query for all cases, but maintaining that table becomes difficult and problematic. It also becomes static, without the ability to adapt to new cases. Perhaps this is the way to go for the future, perhaps a plugin could make this sort of optimization by overriding the rewrite system. But it seems like more trouble than it's worth, really.

http://lists.automattic.com/pipermail/wp-testers/2009-January/011110.html

The rewrite rule matches anything that is not emptystring and forwards it to the WordPress index.php.

Rules prior to that one cause that rule to execute only if the file or directory that is requested doesn't physically exist. So if you have a file called "ku.php" in your web root and someone makes a request for it, then they receive it. But if someone makes a request for ku.php and the file isn't present, then the request is redirected toward WordPress' index.php.

From there, the WP_Rewrite class takes over.

Tricks and Tips

Force Re-Creating .htaccess

add_action('admin_init', create_function('','global $wp_rewrite; $wp_rewrite->flush_rules();'));

Example var_dump of WP_Rewrite

[use_trailing_slashes] => FALSE
[use_verbose_rules] => FALSE
[use_verbose_page_rules] => TRUE
[permalink_structure] => /%category%/%postname%.html
[author_base] => author
[author_structure] => /author/%author%
[date_structure] => /%year%/%monthnum%/%day%
[page_structure] => %pagename%
[search_base] => search
[search_structure] => search/%search%
[comments_base] => comments
[feed_base] => feed
[front] => /
[root] =>
[index] => index.php
[matches] => matches
[rules] =>
    index.php?category_name=$matches[1]&feed=$matches[2]
    index.php?category_name=$matches[1]&feed=$matches[2]
    index.php?category_name=$matches[1]&paged=$matches[2]
    index.php?category_name=$matches[1]
    index.php?tag=$matches[1]&feed=$matches[2]
    index.php?tag=$matches[1]&feed=$matches[2]
    index.php?tag=$matches[1]&paged=$matches[2]
    index.php?tag=$matches[1]
    index.php?post_format=$matches[1]&feed=$matches[2]
    index.php?post_format=$matches[1]&feed=$matches[2]
    index.php?post_format=$matches[1]&paged=$matches[2]
    index.php?post_format=$matches[1]
    index.php?robots=1
    index.php?feed=old
    index.php?register=true
    index.php?&feed=$matches[1]
    index.php?&feed=$matches[1]
    index.php?&paged=$matches[1]
    index.php?&feed=$matches[1]&withcomments=1
    index.php?&feed=$matches[1]&withcomments=1
    index.php?&paged=$matches[1]
    index.php?s=$matches[1]&feed=$matches[2]
    index.php?s=$matches[1]&feed=$matches[2]
    index.php?s=$matches[1]&paged=$matches[2]
    index.php?s=$matches[1]
    index.php?author_name=$matches[1]&feed=$matches[2]
    index.php?author_name=$matches[1]&feed=$matches[2]
    index.php?author_name=$matches[1]&paged=$matches[2]
    index.php?author_name=$matches[1]
    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]
    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]
    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]
    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]
    index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]
    index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]
    index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]
    index.php?year=$matches[1]&monthnum=$matches[2]
    index.php?year=$matches[1]&feed=$matches[2]
    index.php?year=$matches[1]&feed=$matches[2]
    index.php?year=$matches[1]&paged=$matches[2]
    index.php?year=$matches[1]
    index.php?attachment=$matches[1]
    index.php?attachment=$matches[1]&tb=1
    index.php?attachment=$matches[1]&feed=$matches[2]
    index.php?attachment=$matches[1]&feed=$matches[2]
    index.php?attachment=$matches[1]&cpage=$matches[2]
    index.php?pagename=$matches[1]&tb=1
    index.php?pagename=$matches[1]&feed=$matches[2]
    index.php?pagename=$matches[1]&feed=$matches[2]
    index.php?pagename=$matches[1]&paged=$matches[2]
    index.php?pagename=$matches[1]&cpage=$matches[2]
    index.php?pagename=$matches[1]&page=$matches[2]
    index.php?attachment=$matches[1]
    index.php?attachment=$matches[1]&tb=1
    index.php?attachment=$matches[1]&feed=$matches[2]
    index.php?attachment=$matches[1]&feed=$matches[2]
    index.php?attachment=$matches[1]&cpage=$matches[2]
    index.php?category_name=$matches[1]&name=$matches[2]&tb=1
    index.php?category_name=$matches[1]&name=$matches[2]&feed=$matches[3]
    index.php?category_name=$matches[1]&name=$matches[2]&feed=$matches[3]
    index.php?category_name=$matches[1]&name=$matches[2]&paged=$matches[3]
    index.php?category_name=$matches[1]&name=$matches[2]&cpage=$matches[3]
    index.php?category_name=$matches[1]&name=$matches[2]&page=$matches[3]
    index.php?attachment=$matches[1]
    index.php?attachment=$matches[1]&tb=1
    index.php?attachment=$matches[1]&feed=$matches[2]
    index.php?attachment=$matches[1]&feed=$matches[2]
    index.php?attachment=$matches[1]&cpage=$matches[2]
    index.php?category_name=$matches[1]&feed=$matches[2]
    index.php?category_name=$matches[1]&feed=$matches[2]
    index.php?category_name=$matches[1]&paged=$matches[2]
    index.php?category_name=$matches[1]&cpage=$matches[2]
    index.php?category_name=$matches[1]

[extra_rules_top]
    [category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2]
    [category/(.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2]
    [category/(.+?)/page/?([0-9]{1,})/?$] => index.php?category_name=$matches[1]&paged=$matches[2]
    [category/(.+?)/?$] => index.php?category_name=$matches[1]
    [tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2]
    [tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2]
    [tag/([^/]+)/page/?([0-9]{1,})/?$] => index.php?tag=$matches[1]&paged=$matches[2]
    [tag/([^/]+)/?$] => index.php?tag=$matches[1]
    [type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?post_format=$matches[1]&feed=$matches[2]
    [type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?post_format=$matches[1]&feed=$matches[2]
    [type/([^/]+)/page/?([0-9]{1,})/?$] => index.php?post_format=$matches[1]&paged=$matches[2]
    [type/([^/]+)/?$] => index.php?post_format=$matches[1]

[extra_permastructs] =>
    category/%category%
    tag/%post_tag%
    /type/%post_format%

[rewritecode] =>
    %year%
    %monthnum%
    %day%
    %hour%
    %minute%
    %second%
    %postname%
    %post_id%
    %author%
    %pagename%
    %search%
    %category%
    %post_tag%
    %post_format%

[rewritereplace] =>
    ([0-9]{4})
    ([0-9]{1,2})
    ([0-9]{1,2})
    ([0-9]{1,2})
    ([0-9]{1,2})
    ([0-9]{1,2})
    ([^/]+)
    ([0-9]+)
    ([^/]+)
    (.?.+?)
    (.+)
    (.+?)
    ([^/]+)
    ([^/]+)

[queryreplace] =>
    year=
    monthnum=
    day=
    hour=
    minute=
    second=
    name=
    p=
    author_name=
    pagename=
    s=
    category_name=
    tag=
    post_format=

[feeds] =>
    feed
    rdf
    rss
    rss2
    atom

[robots_rewrite] =>
    [robots.txt$] => index.php?robots=1

[default_feeds] =>
    [.*wp-atom.php$] => index.php?feed=atom
    [.*wp-rdf.php$] => index.php?feed=rdf
    [.*wp-rss.php$] => index.php?feed=rss
    [.*wp-rss2.php$] => index.php?feed=rss2
    [.*wp-feed.php$] => index.php?feed=feed
    [.*wp-commentsrss2.php$] => index.php?feed=rss2&withcomments=1

[page_rewrite] =>
    [.?.+?/attachment/([^/]+)/?$] => index.php?attachment=$matches[1]
    [.?.+?/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1
    [.?.+?/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]
    [.?.+?/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]
    [.?.+?/attachment/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]
    [(.?.+?)/trackback/?$] => index.php?pagename=$matches[1]&tb=1
    [(.?.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?pagename=$matches[1]&feed=$matches[2]
    [(.?.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?pagename=$matches[1]&feed=$matches[2]
    [(.?.+?)/page/?([0-9]{1,})/?$] => index.php?pagename=$matches[1]&paged=$matches[2]
    [(.?.+?)/comment-page-([0-9]{1,})/?$] => index.php?pagename=$matches[1]&cpage=$matches[2]
    [(.?.+?)(/[0-9]+)?/?$] => index.php?pagename=$matches[1]&page=$matches[2]

[root_rewrite] =>
    [feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]
    [(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]
    [page/?([0-9]{1,})/?$] => index.php?&paged=$matches[1]

[comments_rewrite] =>
    [comments/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]&withcomments=1
    [comments/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]&withcomments=1
    [comments/page/?([0-9]{1,})/?$] => index.php?&paged=$matches[1]

[search_rewrite] =>
     => index.php?s=$matches[1]&feed=$matches[2]
     => index.php?s=$matches[1]&feed=$matches[2]
    {1,})/?$] => index.php?s=$matches[1]&paged=$matches[2]
     => index.php?s=$matches[1]

[category_rewrite] =>
    [category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2]
    [category/(.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2]
    [category/(.+?)/page/?([0-9]{1,})/?$] => index.php?category_name=$matches[1]&paged=$matches[2]
    [category/(.+?)/?$] => index.php?category_name=$matches[1]

[tag_rewrite] =>
    [tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2]
    [tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2]
    [tag/([^/]+)/page/?([0-9]{1,})/?$] => index.php?tag=$matches[1]&paged=$matches[2]
    [tag/([^/]+)/?$] => index.php?tag=$matches[1]

[author_rewrite] =>
    [author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2]
    [author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2]
    [author/([^/]+)/page/?([0-9]{1,})/?$] => index.php?author_name=$matches[1]&paged=$matches[2]
    [author/([^/]+)/?$] => index.php?author_name=$matches[1]

[date_rewrite] =>
    [([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]
    [([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]
    [([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]
    [([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]
    [([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]
    [([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]
    [([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]
    [([0-9]{4})/([0-9]{1,2})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]
    [([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&feed=$matches[2]
    [([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&feed=$matches[2]
    [([0-9]{4})/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&paged=$matches[2]
    [([0-9]{4})/?$] => index.php?year=$matches[1]

[post_rewrite] =>
    [.+?/[^/]+.html/attachment/([^/]+)/?$] => index.php?attachment=$matches[1]
    [.+?/[^/]+.html/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1
    [.+?/[^/]+.html/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]
    [.+?/[^/]+.html/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]
    [.+?/[^/]+.html/attachment/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]
    [(.+?)/([^/]+).html/trackback/?$] => index.php?category_name=$matches[1]&name=$matches[2]&tb=1
    [(.+?)/([^/]+).html/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&name=$matches[2]&feed=$matches[3]
    [(.+?)/([^/]+).html/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&name=$matches[2]&feed=$matches[3]
    [(.+?)/([^/]+).html/page/?([0-9]{1,})/?$] => index.php?category_name=$matches[1]&name=$matches[2]&paged=$matches[3]
    [(.+?)/([^/]+).html/comment-page-([0-9]{1,})/?$] => index.php?category_name=$matches[1]&name=$matches[2]&cpage=$matches[3]
    [(.+?)/([^/]+).html(/[0-9]+)?/?$] => index.php?category_name=$matches[1]&name=$matches[2]&page=$matches[3]
    [.+?/[^/]+.html/([^/]+)/?$] => index.php?attachment=$matches[1]
    [.+?/[^/]+.html/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1
    [.+?/[^/]+.html/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]
    [.+?/[^/]+.html/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]
    [.+?/[^/]+.html/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]
    [(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2]
    [(.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2]
    [(.+?)/page/?([0-9]{1,})/?$] => index.php?category_name=$matches[1]&paged=$matches[2]
    [(.+?)/comment-page-([0-9]{1,})/?$] => index.php?category_name=$matches[1]&cpage=$matches[2]
    [(.+?)/?$] => index.php?category_name=$matches[1]

[Permastructs] =>
    [get_date_permastruct] => /%year%/%monthnum%/%day%
    [get_year_permastruct] => /%year%/
    [get_month_permastruct] => /%year%/%monthnum%/
    [get_day_permastruct] => /%year%/%monthnum%/%day%
    [get_category_permastruct] => category/%category%
    [get_tag_permastruct] => tag/%post_tag%
    [get_author_permastruct] => /author/%author%
    [get_search_permastruct] => search/%search%
    [get_page_permastruct] => %pagename%
    [get_feed_permastruct] => feed/%feed%
    [get_comment_feed_permastruct] => comments/feed/%feed%

[wp_rewrite_rules] =>
    index.php?category_name=$matches[1]&feed=$matches[2]
    index.php?category_name=$matches[1]&feed=$matches[2]
    index.php?category_name=$matches[1]&paged=$matches[2]
    index.php?category_name=$matches[1]
    index.php?tag=$matches[1]&feed=$matches[2]
    index.php?tag=$matches[1]&feed=$matches[2]
    index.php?tag=$matches[1]&paged=$matches[2]
    index.php?tag=$matches[1]
    index.php?post_format=$matches[1]&feed=$matches[2]
    index.php?post_format=$matches[1]&feed=$matches[2]
    index.php?post_format=$matches[1]&paged=$matches[2]
    index.php?post_format=$matches[1]
    index.php?robots=1
    index.php?feed=old
    index.php?register=true
    index.php?&feed=$matches[1]
    index.php?&feed=$matches[1]
    index.php?&paged=$matches[1]
    index.php?&feed=$matches[1]&withcomments=1
    index.php?&feed=$matches[1]&withcomments=1
    index.php?&paged=$matches[1]
    index.php?s=$matches[1]&feed=$matches[2]
    index.php?s=$matches[1]&feed=$matches[2]
    index.php?s=$matches[1]&paged=$matches[2]
    index.php?s=$matches[1]
    index.php?author_name=$matches[1]&feed=$matches[2]
    index.php?author_name=$matches[1]&feed=$matches[2]
    index.php?author_name=$matches[1]&paged=$matches[2]
    index.php?author_name=$matches[1]
    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]
    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]
    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]
    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]
    index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]
    index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]
    index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]
    index.php?year=$matches[1]&monthnum=$matches[2]
    index.php?year=$matches[1]&feed=$matches[2]
    index.php?year=$matches[1]&feed=$matches[2]
    index.php?year=$matches[1]&paged=$matches[2]
    index.php?year=$matches[1]
    index.php?attachment=$matches[1]
    index.php?attachment=$matches[1]&tb=1
    index.php?attachment=$matches[1]&feed=$matches[2]
    index.php?attachment=$matches[1]&feed=$matches[2]
    index.php?attachment=$matches[1]&cpage=$matches[2]
    index.php?pagename=$matches[1]&tb=1
    index.php?pagename=$matches[1]&feed=$matches[2]
    index.php?pagename=$matches[1]&feed=$matches[2]
    index.php?pagename=$matches[1]&paged=$matches[2]
    index.php?pagename=$matches[1]&cpage=$matches[2]
    index.php?pagename=$matches[1]&page=$matches[2]
    index.php?attachment=$matches[1]
    index.php?attachment=$matches[1]&tb=1
    index.php?attachment=$matches[1]&feed=$matches[2]
    index.php?attachment=$matches[1]&feed=$matches[2]
    index.php?attachment=$matches[1]&cpage=$matches[2]
    index.php?category_name=$matches[1]&name=$matches[2]&tb=1
    index.php?category_name=$matches[1]&name=$matches[2]&feed=$matches[3]
    index.php?category_name=$matches[1]&name=$matches[2]&feed=$matches[3]
    index.php?category_name=$matches[1]&name=$matches[2]&paged=$matches[3]
    index.php?category_name=$matches[1]&name=$matches[2]&cpage=$matches[3]
    index.php?category_name=$matches[1]&name=$matches[2]&page=$matches[3]
    index.php?attachment=$matches[1]
    index.php?attachment=$matches[1]&tb=1
    index.php?attachment=$matches[1]&feed=$matches[2]
    index.php?attachment=$matches[1]&feed=$matches[2]
    index.php?attachment=$matches[1]&cpage=$matches[2]
    index.php?category_name=$matches[1]&feed=$matches[2]
    index.php?category_name=$matches[1]&feed=$matches[2]
    index.php?category_name=$matches[1]&paged=$matches[2]
    index.php?category_name=$matches[1]&cpage=$matches[2]
    index.php?category_name=$matches[1]

[mod_rewrite_rules] =>
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    


[page_rewrite_rules] =>
    index.php?attachment=$matches[1]
    index.php?attachment=$matches[1]&tb=1
    index.php?attachment=$matches[1]&feed=$matches[2]
    index.php?attachment=$matches[1]&feed=$matches[2]
    index.php?attachment=$matches[1]&cpage=$matches[2]
    index.php?pagename=$matches[1]&tb=1
    index.php?pagename=$matches[1]&feed=$matches[2]
    index.php?pagename=$matches[1]&feed=$matches[2]
    index.php?pagename=$matches[1]&paged=$matches[2]
    index.php?pagename=$matches[1]&cpage=$matches[2]
    index.php?pagename=$matches[1]&page=$matches[2]

See Also

Htaccess Htaccess wordpress

 

 

Comments