CINXE.COM
Using Permalinks « WordPress Codex
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> <head><script type="text/javascript" src="https://web-static.archive.org/_static/js/bundle-playback.js?v=7YQSqjSh" charset="utf-8"></script> <script type="text/javascript" src="https://web-static.archive.org/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="https://web-static.archive.org/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("https://web.archive.org/web"); __wm.wombat("http://codex.wordpress.org/Using_Permalinks","20091004170946","https://web.archive.org/","web","https://web-static.archive.org/_static/", "1254676186"); </script> <link rel="stylesheet" type="text/css" href="https://web-static.archive.org/_static/css/banner-styles.css?v=p7PEIJWi" /> <link rel="stylesheet" type="text/css" href="https://web-static.archive.org/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-Style-Type" content="text/css"/> <meta name="generator" content="MediaWiki 1.15.1"/> <meta name="keywords" content="Using Permalinks,Using Permalinks,Changing File Permissions,Editing Files,Glossary,Introduction to Blogging,Linking Posts Pages and Categories,Manage Categories SubPanel,Multilingual Codex,Permalinks Options SubPanel,Submitting Bugs"/> <link rel="shortcut icon" href="/web/20091004170946im_/http://codex.wordpress.org/favicon.ico"/> <link rel="search" type="application/opensearchdescription+xml" href="/web/20091004170946/http://codex.wordpress.org/opensearch_desc.php" title="Codex (en)"/> <link rel="alternate" type="application/rss+xml" title="Codex RSS Feed" href="/web/20091004170946/http://codex.wordpress.org/index.php?title=Special:RecentChanges&feed=rss"/> <link rel="alternate" type="application/atom+xml" title="Codex Atom Feed" href="/web/20091004170946/http://codex.wordpress.org/index.php?title=Special:RecentChanges&feed=atom"/> <title>Using Permalinks « WordPress Codex</title> <style type="text/css"> @import url("https://web.archive.org/web/20091004170946cs_/http://s.wordpress.org/style/codex-wp4.css?1"); @import url("https://web.archive.org/web/20091004170946cs_/http://s.wordpress.org/style/wp4.css"); </style> <link media="only screen and (max-device-width: 480px)" href="https://web.archive.org/web/20091004170946cs_/http://wordpress.org/style/iphone.css" type="text/css" rel="stylesheet"> <!--[if IE]> <style type="text/css"> @import url("http://wordpress.org/style/ie.css?9"); </style> <![endif]--> <link rel="shortcut icon" href="https://web.archive.org/web/20091004170946im_/http://s.wordpress.org/favicon.ico" type="image/x-icon"/> <script src="https://web.archive.org/web/20091004170946js_/http://www.google-analytics.com/urchin.js" type="text/javascript"></script> <script type="text/javascript"> _uacct = "UA-52447-1"; urchinTracker(); </script> <!--[if IE]> <script type="text/javascript" src="/skins/common/IEFixes.js"></script> <meta http-equiv="imagetoolbar" content="no" /> <![endif]--> <script type="text/javascript" src="/web/20091004170946js_/http://codex.wordpress.org/index.php?title=-&action=raw&gen=js&useskin=codex"></script> <script type="text/javascript">wgBreakFrames=false;wgContentLanguage='en';</script> <script type="text/javascript" src="/web/20091004170946js_/http://codex.wordpress.org/skins/common/wikibits.js"></script> </head> <body id="wordpress-org"> <div id="header"> <div class="wrapper"> <h1><a href="https://web.archive.org/web/20091004170946/http://wordpress.org/" title="WordPress">WordPress.org</a></h1> <form action="https://web.archive.org/web/20091004170946/http://wordpress.org/search/do-search.php" method="get" id="head-search"> <input class="text" name="search" type="text" value="Search the Codex" maxlength="150" onfocus="this.value=(this.value=='Search the Codex') ? '' : this.value;" onblur="this.value=(this.value=='') ? 'Search the Codex' : this.value;"/> <input type="submit" class="button" value="Go"/> </form> <ul> <li><a href="https://web.archive.org/web/20091004170946/http://wordpress.org/" title="Home is where the heart is.">Home</a></li> <li><a href="https://web.archive.org/web/20091004170946/http://wordpress.org/showcase/" title="See some of the sites built on WordPress.">Showcase</a></li> <li><a href="https://web.archive.org/web/20091004170946/http://wordpress.org/extend/" title="Taking WordPress beyond your wildest imagination">Extend</a></li> <li><a href="https://web.archive.org/web/20091004170946/http://wordpress.org/about/" title="About the WordPress Organization, and where we're going.">About</a></li> <li><a class="current" href="https://web.archive.org/web/20091004170946/http://codex.wordpress.org/Main_Page" title="Documentation, tutorials, best practices.">Docs</a></li> <li><a href="https://web.archive.org/web/20091004170946/http://wordpress.org/development/" title="Come here for the latest scoop.">Blog</a></li> <li><a href="https://web.archive.org/web/20091004170946/http://wordpress.org/support/" title="Support and discussion forums.">Forums</a></li> <li><a href="https://web.archive.org/web/20091004170946/http://wordpress.org/hosting/" title="Find a home for your blog">Hosting</a></li> <li id="download"><a href="https://web.archive.org/web/20091004170946/http://wordpress.org/download/" title="Get it. Got it? Good.">Download</a></li> </ul> </div> </div> <div id="headline"> <div class="wrapper"> <h2>Codex</h2> <div class="portlet" id="p-personal"> <p class="login">Codex tools: <a href="/web/20091004170946/http://codex.wordpress.org/index.php?title=Special:UserLogin&returnto=Using_Permalinks">Log in / create account</a> </p> </div> </div> </div> <div id="pagebody"> <div class="wrapper"> <div class="col-10" id="bodyContent"> <h2 class="pagetitle">Using Permalinks</h2> <!-- start content --> <p class="LanguageLinks" style="border:1px solid #CCCCCC; line-height:1.5; text-align:left; color:#333333; font-size:90%; padding:10px;"><span style="white-space:nowrap;"><a href="/web/20091004170946/http://codex.wordpress.org/Multilingual_Codex" title="Multilingual Codex">Languages</a>:</span> <strong class="selflink">English</strong> • <a href="/web/20091004170946/http://codex.wordpress.org/es:Using_Permalinks" title="es:Using Permalinks">Español</a> • <a href="https://web.archive.org/web/20091004170946/http://www.wordpress-it.it/wiki/Main/Using+Permalink" class="external text" title="http://www.wordpress-it.it/wiki/Main/Using+Permalink">Italiano</a> • <a href="https://web.archive.org/web/20091004170946/http://wpdocs.sourceforge.jp/%E3%83%91%E3%83%BC%E3%83%9E%E3%83%AA%E3%83%B3%E3%82%AF%E3%81%AE%E4%BD%BF%E3%81%84%E6%96%B9" class="external text" title="http://wpdocs.sourceforge.jp/%E3%83%91%E3%83%BC%E3%83%9E%E3%83%AA%E3%83%B3%E3%82%AF%E3%81%AE%E4%BD%BF%E3%81%84%E6%96%B9">日本語</a> • <a href="https://web.archive.org/web/20091004170946/http://codex.wordthai.com/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%83%E0%B8%8A%E0%B9%89_Permalinks" class="external text" title="http://codex.wordthai.com/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%83%E0%B8%8A%E0%B9%89_Permalinks">ไทย</a> • <small>(<a href="/web/20091004170946/http://codex.wordpress.org/Multilingual_Codex#Language_Cross_Reference" title="Multilingual Codex">Add your language</a>)</small> </p> <table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div> <ul> <li class="toclevel-1"><a href="#Permalink_Types"><span class="tocnumber">1</span> <span class="toctext">Permalink Types</span></a> <ul> <li class="toclevel-2"><a href="#Default:_.22Ugly.22"><span class="tocnumber">1.1</span> <span class="toctext">Default: "Ugly"</span></a></li> <li class="toclevel-2"><a href="#mod_rewrite:_.22Pretty_Permalinks.22"><span class="tocnumber">1.2</span> <span class="toctext">mod_rewrite: "Pretty Permalinks"</span></a></li> <li class="toclevel-2"><a href="#PATHINFO:_.22Almost_Pretty.22"><span class="tocnumber">1.3</span> <span class="toctext">PATHINFO: "Almost Pretty"</span></a></li> </ul> </li> <li class="toclevel-1"><a href="#Choosing_your_permalink_structure"><span class="tocnumber">2</span> <span class="toctext">Choosing your permalink structure</span></a> <ul> <li class="toclevel-2"><a href="#Structure_Tags"><span class="tocnumber">2.1</span> <span class="toctext">Structure Tags</span></a></li> <li class="toclevel-2"><a href="#Category_base_and_Tag_base"><span class="tocnumber">2.2</span> <span class="toctext">Category base and Tag base</span></a></li> <li class="toclevel-2"><a href="#Using_only_.25postname.25"><span class="tocnumber">2.3</span> <span class="toctext">Using only %postname%</span></a></li> <li class="toclevel-2"><a href="#Using_.25category.25_with_multiple_categories_on_a_post.2C_or_.25tag.25"><span class="tocnumber">2.4</span> <span class="toctext">Using %category% with multiple categories on a post, or %tag%</span></a></li> </ul> </li> <li class="toclevel-1"><a href="#Using_.22Pretty.22_permalinks"><span class="tocnumber">3</span> <span class="toctext">Using "Pretty" permalinks</span></a> <ul> <li class="toclevel-2"><a href="#Where.27s_my_.htaccess_file.3F"><span class="tocnumber">3.1</span> <span class="toctext">Where's my .htaccess file?</span></a></li> <li class="toclevel-2"><a href="#Creating_and_editing_.28.htaccess.29"><span class="tocnumber">3.2</span> <span class="toctext">Creating and editing (.htaccess)</span></a></li> <li class="toclevel-2"><a href="#Automatically_updating_.htaccess"><span class="tocnumber">3.3</span> <span class="toctext">Automatically updating .htaccess</span></a></li> </ul> </li> <li class="toclevel-1"><a href="#Permalinks_without_mod_rewrite"><span class="tocnumber">4</span> <span class="toctext">Permalinks without mod_rewrite</span></a></li> <li class="toclevel-1"><a href="#Fixing_Permalink_Problems"><span class="tocnumber">5</span> <span class="toctext">Fixing Permalink Problems</span></a> <ul> <li class="toclevel-2"><a href="#Fixing_.htaccess_Generation_Issues"><span class="tocnumber">5.1</span> <span class="toctext">Fixing .htaccess Generation Issues</span></a></li> </ul> </li> <li class="toclevel-1"><a href="#Permalinks.2C_.htaccess.2C_and_MS_Frontpage"><span class="tocnumber">6</span> <span class="toctext">Permalinks, .htaccess, and MS Frontpage</span></a> <ul> <li class="toclevel-2"><a href="#Quick_Fixes.2C_Frontpage_or_Permalinks"><span class="tocnumber">6.1</span> <span class="toctext">Quick Fixes, Frontpage or Permalinks</span></a></li> <li class="toclevel-2"><a href="#Using_FrontPage_AND_Permalinks_Together"><span class="tocnumber">6.2</span> <span class="toctext">Using FrontPage AND Permalinks Together</span></a></li> <li class="toclevel-2"><a href="#Long_Permalinks"><span class="tocnumber">6.3</span> <span class="toctext">Long Permalinks</span></a></li> <li class="toclevel-2"><a href="#Fixing_Other_Issues"><span class="tocnumber">6.4</span> <span class="toctext">Fixing Other Issues</span></a></li> <li class="toclevel-2"><a href="#More_Help"><span class="tocnumber">6.5</span> <span class="toctext">More Help</span></a></li> </ul> </li> <li class="toclevel-1"><a href="#Tips_and_Tricks"><span class="tocnumber">7</span> <span class="toctext">Tips and Tricks</span></a> <ul> <li class="toclevel-2"><a href="#Having_your_posts_end_in_.html"><span class="tocnumber">7.1</span> <span class="toctext">Having your posts end in .html</span></a></li> <li class="toclevel-2"><a href="#Avoiding_interpretation_as_an_archive_link"><span class="tocnumber">7.2</span> <span class="toctext">Avoiding interpretation as an archive link</span></a></li> </ul> </li> <li class="toclevel-1"><a href="#See_Also"><span class="tocnumber">8</span> <span class="toctext">See Also</span></a></li> <li class="toclevel-1"><a href="#External_Resources"><span class="tocnumber">9</span> <span class="toctext">External Resources</span></a></li> </ul> </td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script> <p>Permalinks are the permanent URLs to your individual weblog posts, as well as categories and other lists of weblog postings. A permalink is what another weblogger will use to link to your article (or section), or how you might send a link to your story in an e-mail message. The URL to each post should be permanent, and never change — hence <i>perma</i>link. </p> <a name="Permalink_Types" id="Permalink_Types"></a><h2> <span class="mw-headline"> Permalink Types </span></h2> <p>There are three basic types of WordPress permalinks: </p> <a name="Default:_.22Ugly.22" id="Default:_.22Ugly.22"></a><h3> <span class="mw-headline"> Default: "Ugly" </span></h3> <p>The default looks like </p> <pre>http://example.com/?p=N</pre> <p>where <var>N</var> is the <tt>Post ID</tt> number. It works on all server environments, but it doesn't look as nice as some of the other options. </p> <a name="mod_rewrite:_.22Pretty_Permalinks.22" id="mod_rewrite:_.22Pretty_Permalinks.22"></a><h3> <span class="mw-headline"> mod_rewrite: "Pretty Permalinks" </span></h3> <p>Using mod_rewrite or lighttpd you can produce much nicer permalinks (see <a href="/web/20091004170946/http://codex.wordpress.org/Introduction_to_Blogging#Pretty_Permalinks" title="Introduction to Blogging">Pretty Permalinks</a>). There are many different formats, but the most common, and most versatile looks like </p> <pre> http://example.com/category/post-name/ or http://example.com/year/month/day/post-name</pre> <p>Some people eliminate some or all of the date elements (day, month, year) to have a shorter permalink format. </p><p>Pretty permalinks are available under </p> <ul><li> Apache web server with the <tt>mod_rewrite</tt> module </li><li> Microsoft IIS 7+ web server with the URL Rewrite 1.1+ module and PHP 5 running as FastCGI </li><li> possibly Microsoft IIS 6+ using <a href="https://web.archive.org/web/20091004170946/http://tech.einaregilsson.com/2007/07/30/pretty-wordpress-permalinks-on-iis/" class="external text" title="http://tech.einaregilsson.com/2007/07/30/pretty-wordpress-permalinks-on-iis/">a 404 handler</a> or <a href="https://web.archive.org/web/20091004170946/http://www.micronovae.com/ModRewrite/articles/CleanPermalinksWordpress.html" class="external text" title="http://www.micronovae.com/ModRewrite/articles/CleanPermalinksWordpress.html">Mod-Rewrite Pro</a> </li><li> Lighttpd using <a href="https://web.archive.org/web/20091004170946/http://chrisjohnston.org/2009/setting-up-a-wordpress-blog-on-lighttpd" class="external text" title="http://chrisjohnston.org/2009/setting-up-a-wordpress-blog-on-lighttpd">a 404 handler</a> or <a href="https://web.archive.org/web/20091004170946/http://blog.nix.is/lighttpd-rewrite-rules-for-wordpress" class="external text" title="http://blog.nix.is/lighttpd-rewrite-rules-for-wordpress">mod_rewrite</a> or <a href="https://web.archive.org/web/20091004170946/http://sudhaker.com/web-development/wordpress/wordpress-permalinks-lighttpd.html" class="external text" title="http://sudhaker.com/web-development/wordpress/wordpress-permalinks-lighttpd.html">mod_magnet</a> (see <a href="/web/20091004170946/http://codex.wordpress.org/Using_Permalinks#External_Resources" title="Using Permalinks">External sources</a>) </li></ul> <a name="PATHINFO:_.22Almost_Pretty.22" id="PATHINFO:_.22Almost_Pretty.22"></a><h3> <span class="mw-headline"> PATHINFO: "Almost Pretty" </span></h3> <p><tt>PATHINFO</tt> permalinks look very much like <tt>mod_rewrite</tt> permalinks but for one exception: they have <tt>/index.php</tt> inserted before them, like so: </p> <pre>http://example.com/index.php/yyyy/mm/dd/post-name/</pre> <p>Otherwise, they are the same as the "pretty" <tt>mod_rewrite</tt> permalinks, and are similarly flexible. Anything that <tt>mod_rewrite</tt> permalinks can do, <tt>PATHINFO</tt> permalinks can do, with the help of that <tt>/index.php</tt> part. </p><p>There is a helpful <a href="https://web.archive.org/web/20091004170946/http://www.askapache.com/htaccess/rewriterule-viewer-plugin.html" class="external text" title="http://www.askapache.com/htaccess/rewriterule-viewer-plugin.html">plugin</a> that displays the type of permalinks being used and detailed information on the internal rewrite rules used by WordPress. </p> <a name="Choosing_your_permalink_structure" id="Choosing_your_permalink_structure"></a><h2> <span class="mw-headline"> Choosing your permalink structure </span></h2> <p>In the Settings → Permalinks panel (Options → Permalinks before WordPress 2.5), you can choose one of the "common" structures or enter your own in the "Custom structure" field using the <i>structure tags</i>. </p><p>To activate PATHINFO permalinks, start your permalink structure with <tt>index.php/</tt>. </p><p><a href="/web/20091004170946/http://codex.wordpress.org/File:wordpress-permalinks-structure.gif" class="image" title="File:wordpress-permalinks-structure.gif"><img alt="File:wordpress-permalinks-structure.gif" src="/web/20091004170946im_/http://codex.wordpress.org/images/a/a9/wordpress-permalinks-structure.gif" width="469" height="411" border="0"/></a> </p> <a name="Structure_Tags" id="Structure_Tags"></a><h3> <span class="mw-headline"> Structure Tags </span></h3> <p>You can use these tags to customize your "Pretty" or "Almost Pretty" permalinks. A few hints: </p> <ul><li> Make sure to end your structure with either <tt>%post_id%</tt> or <tt>%postname%</tt> (e.g. <tt>/%year%/%monthnum%/%day%/%postname%/</tt>) so that each permalink points to an individual post. </li><li> For performance reasons, it is <i>not</i> a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text "page slug" as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties). So, it is best to start your permalink structure with a numeric field, such as the year or post ID. See <a href="https://web.archive.org/web/20091004170946/http://comox.textdrive.com/pipermail/wp-testers/2009-January/011097.html" class="external text" title="http://comox.textdrive.com/pipermail/wp-testers/2009-January/011097.html">wp-testers discussion of this topic</a>. </li></ul> <dl><dt><b>%year%</b> </dt><dd> The year of the post, four digits, for example <tt>2004</tt> </dd><dt><b>%monthnum%</b> </dt><dd> Month of the year, for example <tt>05</tt> </dd><dt><b>%day%</b> </dt><dd> Day of the month, for example <tt>28</tt> </dd><dt><b>%hour%</b> </dt><dd> Hour of the day, for example <tt>15</tt> </dd><dt><b>%minute%</b> </dt><dd> Minute of the hour, for example <tt>43</tt> </dd><dt><b>%second%</b> </dt><dd> Second of the minute, for example <tt>33</tt> </dd><dt><b>%postname%</b> </dt><dd> A sanitized version of the title of the post (<i>post slug</i> field on Edit Post/Page panel). So “This Is A Great Post!” becomes <tt>this-is-a-great-post</tt> in the URI (see <a href="/web/20091004170946/http://codex.wordpress.org/Using_Permalinks#Using_only_.25postname.25" title="Using Permalinks">Using only <tt>%postname%</tt></a>). <b>Starting Permalinks with %postname% is strongly not recommended for performance reasons.</b>. </dd><dt><b>%post_id%</b> </dt><dd> The unique ID # of the post, for example <tt>423</tt> </dd><dt><b>%category%</b> </dt><dd> A sanitized version of the category name (<i>category slug</i> field on New/Edit Category panel). Nested sub-categories appear as nested directories in the URI. <b>Starting Permalinks with %category% is strongly not recommended for performance reasons</b>. </dd><dt><b>%tag%</b> </dt><dd> A sanitized version of the tag name (<i>tag slug</i> field on New/Edit Tag panel). <b>Starting Permalinks with %tag% is strongly not recommended for performance reasons</b>. </dd><dt><b>%author%</b> </dt><dd> A sanitized version of the author name. </dd></dl> <a name="Category_base_and_Tag_base" id="Category_base_and_Tag_base"></a><h3> <span class="mw-headline"> Category base and Tag base </span></h3> <p>The <i>Category base</i> and <i>Tag base</i> are prefixes used in URLs for category and tag archives, which look like this: </p> <pre> example.net/wp/<var>category_base</var>/<var>category_name</var> example.net/wp/<var>tag_base</var>/<var>tag_name</var> </pre> <p>The default values for these are <tt>category</tt> and <tt>tag</tt>. You can change them, but you can't remove them from the URLs altogether. </p><p>Custom permalinks work on most systems without any problems, but there are still some conditions where problems occur. </p> <a name="Using_only_.25postname.25" id="Using_only_.25postname.25"></a><h3> <span class="mw-headline"> Using only <tt>%postname%</tt> </span></h3> <p><strong>If using version 2.0 or greater, the following is no longer true as this has been changed.</strong> </p><p>If you use postname as the only element in your permalinks to create a structure such as <tt>example.com/post-title</tt>, the rewrite rules may make it impossible to access pages such as your stylesheet (which has a similar format) or the <tt>/wp-admin/</tt> folder . It's best to include some numeric data (e.g. the post ID or date) in the permalink to prevent this from happening. Additionally, WordPress v1.2.x requires the use of a date structure in order for some features, such as the calendar, to function properly. <tt>/%year%/%monthnum%/%day%/%postname%/</tt> is always a good start. </p> <a name="Using_.25category.25_with_multiple_categories_on_a_post.2C_or_.25tag.25" id="Using_.25category.25_with_multiple_categories_on_a_post.2C_or_.25tag.25"></a><h3> <span class="mw-headline"> Using <tt>%category%</tt> with multiple categories on a post, or <tt>%tag%</tt> </span></h3> <p>When you assign multiple categories to a post, only one can show up in the permalink. This will be the lowest numbered category (see <a href="/web/20091004170946/http://codex.wordpress.org/Manage_Categories_SubPanel" title="Manage Categories SubPanel">Manage Categories</a>). The post will still be accessible through all the categories as normal. </p><p>The same thing applies to using the <tt>%tag%</tt> field in your permalink structure. </p> <a name="Using_.22Pretty.22_permalinks" id="Using_.22Pretty.22_permalinks"></a><h2> <span class="mw-headline"> Using "Pretty" permalinks </span></h2> <p>Requirements: </p> <ul><li> Apache web server with the mod_rewrite module installed </li><li> In WordPress's home directory, <ul><li> The <a href="https://web.archive.org/web/20091004170946/http://httpd.apache.org/docs/1.3/mod/core.html#options" class="external text" title="http://httpd.apache.org/docs/1.3/mod/core.html#options">FollowSymLinks option</a> enabled </li><li> <a href="https://web.archive.org/web/20091004170946/http://httpd.apache.org/docs/1.3/mod/core.html#allowoverride" class="external text" title="http://httpd.apache.org/docs/1.3/mod/core.html#allowoverride"><tt>FileInfo</tt> directives</a> allowed (e.g. <code>AllowOverride FileInfo</code> or <code>AllowOverride All</code>) </li><li> An <tt>.htaccess</tt> file (if this file is missing, WordPress will try to create it when you activate "pretty" permalinks) </li><li> If you want WordPress to update the <tt>.htaccess</tt> file automatically, WordPress will need write access to the file. </li></ul> </li></ul> <ul><li> For lighttpd, see <a href="/web/20091004170946/http://codex.wordpress.org/Using_Permalinks#External_Resources" title="Using Permalinks">External Resources</a>. </li></ul> <p>When you create or update a "pretty" permalink structure, WordPress will generate rewrite rules and attempt to insert them into the proper <tt>.htaccess</tt> file. If it can't, it will say something like <tt>You should update your .htaccess now</tt> and print out the rules for you to copy and paste into the file (put them at the end). </p><p>In WordPress 2.0+ versions, you'll probably need to do this only once, because WordPress does the rewriting internally. If you ever move your WordPress home directory (<i>Blog address</i>), you'll need to repeat this step. </p><p>WordPress will play nice with an existing <tt>.htaccess</tt> and will not delete any existing RewriteRules or other directives. If you have other <tt>mod_rewrite</tt> rules, put yours before WordPress's. </p> <a name="Where.27s_my_.htaccess_file.3F" id="Where.27s_my_.htaccess_file.3F"></a><h3> <span class="mw-headline"> Where's my <tt>.htaccess</tt> file? </span></h3> <p>Wordpress's <tt>index.php</tt> and <tt>.htaccess</tt> files should be together in the directory indicated by the <i>Blog address (URI)</i> setting on your General Options page. Since the name of the file begins with a dot, the file may not be visible through an FTP client unless you change the preferences of the FTP tool to show all files, including the hidden files. Some hosts (e.g. Godaddy) may not show or allow you to edit .htaccess if you install WordPress through the Godaddy Hosting Connection installation. </p> <a name="Creating_and_editing_.28.htaccess.29" id="Creating_and_editing_.28.htaccess.29"></a><h3> <span class="mw-headline"> Creating and editing (<tt>.htaccess</tt>) </span></h3> <p>If you do not already have a .htaccess file, create one. If you have shell or ssh access to the server, a simple <code>touch .htaccess</code> command will create the file. If you are using FTP to transfer files, create a file on your local computer, call it <tt>1.htaccess</tt>, upload it to the root of your WordPress folder, and then rename it to <tt>.htaccess</tt>. </p><p>You can edit the <tt>.htaccess</tt> file by FTP, shell, or (possibly) your host's <a href="/web/20091004170946/http://codex.wordpress.org/Using_cPanel" title="Using cPanel">control panel</a>. </p><p>If your <tt>.htaccess</tt> file contains errors that bring down your site ("Internal Server Error (500)"), you will need to use FTP or your host's <a href="/web/20091004170946/http://codex.wordpress.org/Using_cPanel" title="Using cPanel">control panel</a> to delete the rogue <tt>.htaccess</tt> file. </p> <a name="Automatically_updating_.htaccess" id="Automatically_updating_.htaccess"></a><h3> <span class="mw-headline"> Automatically updating <tt>.htaccess</tt></span></h3> <p>If WordPress can't update your <tt>.htaccess</tt> file automatically, it will tell you something like <tt>If your .htaccess file were writable, we could do this automatically, but it isn’t…</tt> near the bottom of the Options → Permalinks panel. </p><p>If you want to let WordPress do this, you'll need to <a href="/web/20091004170946/http://codex.wordpress.org/Changing_File_Permissions" title="Changing File Permissions">give WordPress write access to the .htaccess file</a>. The exact permissions necessary depend on your server setup. Try adding write permissions for the owner, then group, then world, testing after each change; once WordPress has edited the file successfully, don't add any further write permissions. </p><p>After applying the permalinks, you should change the permissions to something stronger like 660 or 644 to prevent others on the server from potentially having access to it. </p> <a name="Permalinks_without_mod_rewrite" id="Permalinks_without_mod_rewrite"></a><h2> <span class="mw-headline"> Permalinks without <tt>mod_rewrite</tt> </span></h2> <p>"Pretty" permalinks usually require <tt><a href="/web/20091004170946/http://codex.wordpress.org/Glossary#mod_rewrite" title="Glossary">mod_rewrite</a></tt>, and IIS (common on Windows servers) does not support <tt>mod_rewrite</tt>. (If you are using Apache 2.0.54, on Windows, <tt>mod_rewrite</tt> may work, provided it is enabled in <tt>apache\conf\httpd.conf</tt>.) </p><p>If you are using IIS 7 and have admin rights on your server, you can use Microsoft's <a href="https://web.archive.org/web/20091004170946/http://learn.iis.net/page.aspx/460/using-url-rewrite-module/" class="external text" title="http://learn.iis.net/page.aspx/460/using-url-rewrite-module/">URL Rewrite Module</a> instead. Though not completely compatible with <tt>mod_rewrite</tt>, it does support WordPress's pretty permalinks. Once installed, open the <tt>web.config</tt> file in the WordPress folder and add the following rule to the <tt>system.webServer</tt> element </p> <pre> <rewrite> <rules> <rule name="Main Rule" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php" /> </rule> </rules> </rewrite> </pre> <p>There's a <a href="https://web.archive.org/web/20091004170946/http://learn.iis.net/page.aspx/466/enabling-pretty-permalinks-in-wordpress/" class="external text" title="http://learn.iis.net/page.aspx/466/enabling-pretty-permalinks-in-wordpress/">full installation guide</a> on the IIS site. The module is available for <a href="https://web.archive.org/web/20091004170946/http://www.iis.net/downloads/1692/ItemPermaLink.ashx" class="external text" title="http://www.iis.net/downloads/1692/ItemPermaLink.ashx">x64</a> and <a href="https://web.archive.org/web/20091004170946/http://www.iis.net/downloads/1691/ItemPermaLink.ashx" class="external text" title="http://www.iis.net/downloads/1691/ItemPermaLink.ashx">x86</a> systems. </p><p>If this isn't an option, you can try PATHINFO permalinks; put <tt>index.php/</tt> at the start of your custom permalink structure: </p> <pre> /index.php/%year%/%monthnum%/%day%/%postname%/ </pre> <p>This option may not always work, especially in cases of WordPress running on IIS 6. To make this option work on IIS, add these 2 lines to a php.ini file and store that file in your webroot (<cite><a href="https://web.archive.org/web/20091004170946/http://blog.taragana.com/index.php/archive/wordpress-tip-on-permalink-options" class="external free" title="http://blog.taragana.com/index.php/archive/wordpress-tip-on-permalink-options">http://blog.taragana.com/index.php/archive/wordpress-tip-on-permalink-options</a></cite>): </p> <pre> cgi.fix_pathinfo = 1 cgi.force_redirect = 0 </pre> <p>Another solution exists using IIS' custom 404 redirects. It requires that your web host allows you to add a custom 404 redirect, but it doesn't require you to install any 3rd party mod_rewrite software and it also doesn't require that your permalink structure begin with <tt>/index.php/</tt>. </p> <ul><li> <a href="https://web.archive.org/web/20091004170946/http://www.keyboardface.com/IIS-Permalinks/" class="external free" title="http://www.keyboardface.com/IIS-Permalinks/">http://www.keyboardface.com/IIS-Permalinks/</a> </li><li> Another very simple custom 404 redirect solution: <a href="https://web.archive.org/web/20091004170946/http://tech.einaregilsson.com/2007/07/30/pretty-wordpress-permalinks-on-iis/" class="external free" title="http://tech.einaregilsson.com/2007/07/30/pretty-wordpress-permalinks-on-iis/">http://tech.einaregilsson.com/2007/07/30/pretty-wordpress-permalinks-on-iis/</a> </li><li> A newer version of the above solution: <a href="https://web.archive.org/web/20091004170946/http://www.ikailo.com/94/url-modrewrite-workaround-iis-60/" class="external free" title="http://www.ikailo.com/94/url-modrewrite-workaround-iis-60/">http://www.ikailo.com/94/url-modrewrite-workaround-iis-60/</a> </li></ul> <p>If you have administrator privileges on your server, you may be interested in these solutions: </p> <ul><li> <a href="https://web.archive.org/web/20091004170946/http://www.binaryfortress.com/wordpress-url-rewrite/" class="external text" title="http://www.binaryfortress.com/wordpress-url-rewrite/">WordPress URL Rewrite Plugin for blogs running on IIS</a> by Binary Fortress Software </li><li> <a href="https://web.archive.org/web/20091004170946/http://www.deanlee.cn/wordpress/url-rewriting-for-wordpress-under-iis/" class="external text" title="http://www.deanlee.cn/wordpress/url-rewriting-for-wordpress-under-iis/">URL Rewriting for WordPress under IIS</a> by Dean Lee </li></ul> <a name="Fixing_Permalink_Problems" id="Fixing_Permalink_Problems"></a><h2> <span class="mw-headline"> Fixing Permalink Problems </span></h2> <a name="Fixing_.htaccess_Generation_Issues" id="Fixing_.htaccess_Generation_Issues"></a><h3> <span class="mw-headline"> Fixing <tt>.htaccess</tt> Generation Issues </span></h3> <p>If your installation of WordPress does not generate a .htaccess file or if it does not write the new rules onto your existing .htaccess file then there are a couple reasons that could be causing this. Work step by step and continue to the next step only if the previous step does not work. </p> <ol> <li><b>Change File Permissions:</b> You must <a href="/web/20091004170946/http://codex.wordpress.org/Changing_File_Permissions" title="Changing File Permissions"><tt>chmod</tt></a> the <tt>.htaccess</tt> file to 666 to edit it with the WordPress <a href="/web/20091004170946/http://codex.wordpress.org/Editing_Files#Using_the_Built-in_Editor" title="Editing Files">template editor</a>, but this is not recommended, since if you do that, any user of your blog, who can edit templates will be able to edit it. You can change the permissions to 660 to make it server-writable, which again will have the same limitation.</li> <li><b>Server Blockage:</b> Your host might have blocked the <tt>SERVER_SOFTWARE</tt> variable and this will cause WordPress' .htaccess generation to fail. If you are sure that your server is running Apache, you can force WordPress to believe that your server is running Apache by changing your <tt>wp-includes/vars.php</tt> file. Follow the steps below to implement these changes.</li> <ul> <li>Open the <tt>wp-includes/vars.php</tt> file using the built in file editor in your WordPress Admin panel. To navigate to this panel, login to WordPress, click on "Manage", then on "Files", scroll to the bottom and type in <tt>wp-includes/vars.php</tt> into the text box under the "Other Files" title.</li> Look for <pre style="font-size:0.7em">$is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;</pre> and replace it with <pre style="font-size:0.7em">// $is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;</pre> <li>Add a new line under <pre style="font-size:0.7em">// $is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;</pre> and type in <pre style="font-size:0.8em">$is_apache = 1;</pre></li> </ul> <li><b>Users of XAMPP (Windows):</b> Some versions of <a href="https://web.archive.org/web/20091004170946/http://www.apachefriends.org/en/xampp.html" class="external text" title="http://www.apachefriends.org/en/xampp.html">XAMPP</a> do not enable <tt>mod_rewrite</tt> by default (though it <i>is</i> compiled in Apache). To enable it — and thus enable WordPress to write the <tt>.htaccess</tt> file needed to create pretty permalinks — you must open <tt>apache/conf/httpd.conf</tt> and uncomment the line <tt>LoadModule rewrite_module modules/mod_rewrite.so</tt> (i.e., delete the hash/pound sign at the front of the line).</li> </ol> <a name="Permalinks.2C_.htaccess.2C_and_MS_Frontpage" id="Permalinks.2C_.htaccess.2C_and_MS_Frontpage"></a><h2> <span class="mw-headline"> Permalinks, .htaccess, and MS Frontpage </span></h2> <p>A note about Microsoft Frontpage: many servers (shared and dedicated) maintained and built by various hosting companies come with <tt>mod_frontpage</tt> compiled with the apache build, and in many cases with the Frontpage Server Extensions installed, on each virtual server. This is more common than not, many/most binary distributions used in the server build process at most hosting companies these days include both mod_fronpage and the server extensions. Even if you're not using Frontpage, because of the way that the extensions interact with apache (and the <tt>httpd.conf</tt> file) you'll likely get something like a 500 error or blank white page when trying to view your WP install (although the admin panel may operate correctly) simply because <tt>extensions/mod_frontpage</tt> exist on your server. </p><p>Wordpress will operate correctly with the Frontpage Extensions installed, however permalinks will not function at all and <b>ANY</b> change to the permalinks section from the Wordpress admin interface will cause corruption of the Frontpage server extensions due to the addition of the <tt>mod_rewrite</tt> rules to the .htaccess file. <i>There is however now a fix for this situation.</i> </p> <a name="Quick_Fixes.2C_Frontpage_or_Permalinks" id="Quick_Fixes.2C_Frontpage_or_Permalinks"></a><h3> <span class="mw-headline"> Quick Fixes, Frontpage or Permalinks </span></h3> <p><b>Frontpage Extensions Fix:</b> If you don't care about permalinks and just want to make the MS Frontpage server extensions work again, simply edit your .htaccess file and remove the WordPress section with the rewrite rules. </p><p><b>To Use Permalinks:</b> If you don't care about Frontpage(but your hosting company has the extensions installed) </p><p>You will need to remove (or have your hosting company do so) the MS Frontpage server extensions, or simply edit the .htaccess file to removed all of the Frontpage Lines, leaving only the WordPress mod_rewrite code. </p> <a name="Using_FrontPage_AND_Permalinks_Together" id="Using_FrontPage_AND_Permalinks_Together"></a><h3> <span class="mw-headline"> Using FrontPage AND Permalinks Together </span></h3> <p><b>Finally, A solution.</b> </p><p>There have been a number of threads on this issue in the support forums, and until now, no solution to the problem. </p><p>Normally, on a Unix server with the Microsoft FrontPage Server extensions installed WordPress works just fine and you are able to edit and publish pages (with <a href="https://web.archive.org/web/20091004170946/http://www.microsoft.com/frontpage/" class="external text" title="http://www.microsoft.com/frontpage/">Microsoft FrontPage</a>) — <b>until</b> — you make a change to the permalinks (for example to the date based kind that I like /2005/04/etc). I often suggest that type of URI to folks asking about permalinks etc, as that is the method recommended by the w3c (see <a href="https://web.archive.org/web/20091004170946/http://www.w3.org/Provider/Style/URI" class="external free" title="http://www.w3.org/Provider/Style/URI">http://www.w3.org/Provider/Style/URI</a> ). </p><p>Now, the problem is that FrontPage uses the .htaccess file (which the WordPress mod_rewrite rules must access) for its "publishing" and "web authoring" configuration. As soon as the WordPress mod_rewrite code is added to the file, two things happen — the permalinks don't work and the Frontpage Server extensions become corrupt. </p><p>I have tried countless ways to get around this, including trying to use rewrite rules that "ignore" the <tt>%{HTTP_USERAGENT)%</tt> used by FrontPage, to using a second AccessFilename <tt>.wpaccess</tt> to the <tt>httpd.conf</tt> file, and a host of other things, and nothing worked to allow use of FrontPage <i>and</i> management and use of permalinks in WordPress at the same time. </p><p>The solution is actually simple, and I figured it out by accident. </p><p>If you are using, or wish to use FrontPage (or if your hosting package is pre-configured that way) along with WordPress, you'll need to take the following simple steps on your server or have your hosting company do them for you. </p><p>Microsoft FrontPage creates the following directory </p> <pre>_vti_bin</pre> Nested within that it creates both <pre>_vti_adm</pre> and <pre>_vti_aut</pre> <p>In addition to in your site (or WordPress) root folder in all of those directories you will find additional <tt>.htaccess</tt> files. </p><p>In all three of these directories AND in the root directory, at the top of ALL of the <tt>.htaccess</tt> files you simply need to add one line: </p> <pre> Options +FollowSymlinks </pre> <p>There may or may not already be a line in each like </p> <pre>Options None</pre> <p>Edit and save each <tt>.htaccess</tt> file and you're done. Now everything works perfectly, including FrontPage, AND the permalinks of your choosing. </p> <a name="Long_Permalinks" id="Long_Permalinks"></a><h3> <span class="mw-headline"> Long Permalinks </span></h3> <p>When using extra long permalinks in email and posting in comments and chats, some long permalinks are "chopped off" or only the first section is actually recognized as a link and the end seen as text. Here is an example. </p> <div style="margin: 5px; padding:5px"> <tt style="font-weight:bold; color:#036; text-decoration:underline; font-size:0.9em"><a href="https://web.archive.org/web/20091004170946/http://yourdomain.example.com/2005/10/4/article-about-joe-fred-sally-and-bog" class="external free" title="http://yourdomain.example.com/2005/10/4/article-about-joe-fred-sally-and-bog">http://yourdomain.example.com/2005/10/4/article-about-joe-fred-sally-and-bog</a></tt></div> <p>Can result in: </p> <div style="margin:5px; padding 5px"><tt> <span style="font-weight:bold; color:#036; text-decoration:underline; font-size:0.9em"><a href="https://web.archive.org/web/20091004170946/http://yourdomain.example.com/2005/10/4/article" class="external free" title="http://yourdomain.example.com/2005/10/4/article">http://yourdomain.example.com/2005/10/4/article</a></span>-about-joe-fred-sally-and-bog</tt> </div> <p>To click on the lower link, the user would get a 404 Page Not Found Error. If you have a tendency to use very long permalink post titles, take these steps to prevent this problem. </p><p>1. Check that you are indeed using <strong class="selflink">Permalinks</strong>. </p><p>2. Edit your <tt>.htaccess</tt> file and add the following: </p> <pre style="font-size: 0.7em"> RewriteRule ^post/([0-9]+)?/?([0-9]+)?/?$ /index.php?p=$1&page=$2 [QSA] </pre> <p>3. Test it. Find a post's ID number and type the following (with your information) in your browser and you should be redirected to your post: </p> <pre> http://yourdomain.example.com/post/(the ID #) </pre> <p>It is also worth noting that most email software will not cut off URLs that have been delineated with angle-brackets (< and >), so when pasting URLs into emails, you should write them as so: </p> <div style="margin: 5px; padding:5px"> <tt>Read my blog post at <<span style="text-decoration:underline; color:blue"><a href="https://web.archive.org/web/20091004170946/http://yourdomain.example.com/2005/10/4/article-about-joe-fred-sally-and-bog" class="external free" title="http://yourdomain.example.com/2005/10/4/article-about-joe-fred-sally-and-bog">http://yourdomain.example.com/2005/10/4/article-about-joe-fred-sally-and-bog</a></span>></tt></div> <p>Additionally, some decent email clients offer a "preformat" option when composing plain-text emails. Using the "preformat" option when pasting links will force the email client not to insert linebreaks inside the links. </p> <a name="Fixing_Other_Issues" id="Fixing_Other_Issues"></a><h3> <span class="mw-headline"> Fixing Other Issues </span></h3> <p>If your <tt>.htaccess</tt> file is being generated correctly, but Permalinks still do not function, the following might be a problem. If problems persist, post a note in the <a href="https://web.archive.org/web/20091004170946/http://www.wordpress.org/support" class="external text" title="http://www.wordpress.org/support">WordPress Forum's</a> How To section. </p> <dl><dt><b>AllowOverride Not Enabled</b> </dt><dd>Your server may not have the AllowOverride directive enabled. If the AllowOverride directive is set to <tt>None</tt> in your Apache <tt>httpd.config</tt> file, then <tt>.htaccess</tt> files are completely ignored. In this case, the server will not even attempt to read <tt>.htaccess</tt> files in the filesystem. When this directive is set to <tt>All</tt>, then any directive which has the <tt>.htaccess</tt> Context is allowed in .htaccess files. Example of enabled AllowOverride directive in <tt>httpd.config</tt>: </dd></dl> <pre> <Directory /> Options FollowSymLinks AllowOverride All </Directory> </pre> <p>You may also have to enable the AllowOverride directive in your DocumentRoot: </p> <pre> <Directory /var/www/html> # ... other directives... AllowOverride All </Directory> </pre> <dl><dd>You may also have to change the AllowOverride settings for the site. This is surely the case when using Mac OS X Server, but might be likewise with other systems. Usually you can find the site configuration files in <tt>/etc/httpd/sites/</tt> </dd></dl> <dl><dd>If you don't want to set AllowOverride to all (as it is above) then your AllowOverride list must include the FileInfo directive. You must restart your Apache server for any <tt>httpd.config</tt> file changes to take effect. For more information on which overrides are allowed, read about <a href="https://web.archive.org/web/20091004170946/http://httpd.apache.org/docs-2.0/mod/core.html#allowoverride" class="external text" title="http://httpd.apache.org/docs-2.0/mod/core.html#allowoverride">Apache Core Features</a>. </dd></dl> <dl><dt>Paged Navigation Doesn't Work </dt><dd>Sometimes navigation to second (and subsequent) pages of posts does not work as expected. Your page may generate a link to a page with one of these URIs: </dd></dl> <pre> http://www.example.com/page/2/ http://www.example.name/category/categoryname/page/2/ http://www.example/year/month/day/page/2/ http://www.example/year/month/page/2/ </pre> <dl><dd>The result of clicking one of those links is that the page loads with all the surroundings (header, footer, sidebar), but instead of a page of posts, there is an error message: "Sorry, no posts match that criteria." </dd></dl> <dl><dd>This is due to a glitch in the <tt>.htaccess</tt> file that WordPress generates. To fix it, delete the contents of your .htaccess file and re-create it. </dd></dl> <ol> <li>In the Control Panel, go to Manage > Files (<a href="/web/20091004170946/http://codex.wordpress.org/Editing_Files" title="Editing Files">More Info on Editing Files</a>)</li> <li>Click the link to your .htaccess file to edit its contents</li> <li>Copy the contents of the file and paste it to a text file in a text editor. This is a precaution in case your .htaccess file has manual entries for redirects, denials or other <a href="https://web.archive.org/web/20091004170946/http://www.javascriptkit.com/howto/htaccess.shtml" class="external text" title="http://www.javascriptkit.com/howto/htaccess.shtml">handy htaccess tricks</a></li> <li>Delete all contents from your .htaccess file and click the Update File button.</li> <li>In the Control Panel, go to Options > Permalinks.</li> <li>Click the Update Permalink Structure button to freshly generate new rewrite rules for your permalinks.</li> <li>Test the results using a link that had previously broken.</li> <li>Add any manual htaccess entries back in your file (Place manual htaccess entries before the <tt># BEGIN WordPress</tt> or after <tt># END WordPress</tt> lines.)</li> </ol> <dl><dd>You may also perform similar steps by deleting the <tt>.htaccess</tt> files from the server, creating a fresh empty .htaccess file, changing its permissions to 666, and then in Options > Permalinks generate a new set of htaccess rules by clicking the Update Permalinks Structure button. </dd></dl> <dl><dd>If that still doesn't work, take a look at the WordPress support forums, specifically, <a href="https://web.archive.org/web/20091004170946/http://wordpress.org/support/topic/51613#post-283222" class="external text" title="http://wordpress.org/support/topic/51613#post-283222">this support post</a>. </dd></dl> <dl><dt><b>Permalinks to pages don't work</b> </dt><dd>If you've tried to navigate to a newly created <a href="/web/20091004170946/http://codex.wordpress.org/Glossary#Page" title="Glossary">Page</a> and encounter an error, you likely need to <a href="/web/20091004170946/http://codex.wordpress.org/Permalinks_Options_SubPanel" title="Permalinks Options SubPanel" class="mw-redirect">update your Permalink structure</a>. Remember, each time you add a new static Page to WordPress, new rules must be generated and updated to <tt>.htaccess</tt> (WordPress 1.X) or to the internal rewrites array (WordPress 2.X). </dd></dl> <dl><dt><b>Permalinks to Ultimate Tag Warrior tag pages don't work</b> </dt><dd>If you get 404 errors on local tag URLs when using the UltimateTagWarrior plugin on WordPress 2.X, it's because the internal rewrites generated by WordPress are being overly greedy and getting invoked before UTW's rewrite rules have a chance. This usually occurs only when using a custom permalink structure (like <tt>/%postname%/</tt>). To fix it, either <a href="/web/20091004170946/http://codex.wordpress.org/Permalinks_Options_SubPanel" title="Permalinks Options SubPanel" class="mw-redirect">switch your Permalink structure</a> to "Date and name based" or hack the UTW plugin to place the UTW rewrites at the top of the internal rewrites array. <a href="https://web.archive.org/web/20091004170946/http://www.naturalsearchblog.com/archives/2007/01/20/getting-404-errors-on-ultimate-tag-warrior/" class="external text" title="http://www.naturalsearchblog.com/archives/2007/01/20/getting-404-errors-on-ultimate-tag-warrior/">More Info on this</a>. </dd></dl> <dl><dt><b>Permalinks work but no pages are returned</b> </dt><dd>Some versions of PHP 4.4.x and 5.x have a bug that causes mod_rewrite to fail when used with some versions of Apache 2.x. More details at <a href="https://web.archive.org/web/20091004170946/http://bugs.php.net/bug.php?id=35096" class="external free" title="http://bugs.php.net/bug.php?id=35096">http://bugs.php.net/bug.php?id=35096</a> and <a href="https://web.archive.org/web/20091004170946/http://bugs.php.net/bug.php?id=35059" class="external free" title="http://bugs.php.net/bug.php?id=35059">http://bugs.php.net/bug.php?id=35059</a>. </dd></dl> <a name="More_Help" id="More_Help"></a><h3> <span class="mw-headline"> More Help </span></h3> <p>If these steps do not work, search for your problem in the <a href="https://web.archive.org/web/20091004170946/http://codex.wordpress.org/" class="external text" title="http://codex.wordpress.org">Codex</a>, <a href="/web/20091004170946/http://codex.wordpress.org/Troubleshooting" title="Troubleshooting">Troubleshooting</a>, or in the <a href="https://web.archive.org/web/20091004170946/http://wordpress.org/support/" class="external text" title="http://wordpress.org/support/">Support Forum</a>. As a last resort, <a href="/web/20091004170946/http://codex.wordpress.org/Submitting_Bugs" title="Submitting Bugs" class="mw-redirect">file a bug report</a>. </p> <a name="Tips_and_Tricks" id="Tips_and_Tricks"></a><h2> <span class="mw-headline"> Tips and Tricks </span></h2> <p>If you want to list your site in Google News, one of the requirements is to have at least three digit identifier at the end of every url. </p><p>This is easily accomplished using %postname%-%post_id% structure, which will append post ID to the end of URL so it becomes <a href="https://web.archive.org/web/20091004170946/http://mysite.com/cooking-tips-tricks-344" class="external free" title="http://mysite.com/cooking-tips-tricks-344">http://mysite.com/cooking-tips-tricks-344</a>. </p> <a name="Having_your_posts_end_in_.html" id="Having_your_posts_end_in_.html"></a><h3> <span class="mw-headline"> Having your posts end in <tt>.html</tt> </span></h3> <p>There's an easy way to having your posts end in a <tt>.html</tt> extension, using the structure tags above. Following the example used on properly terminating permalinks, you could have a page like <a href="https://web.archive.org/web/20091004170946/http://yoursite.com/2006/01/01/happy-newyear.html" class="external free" title="http://yoursite.com/2006/01/01/happy-newyear.html">http://yoursite.com/2006/01/01/happy-newyear.html</a> with this rule: </p> <pre> /%year%/%monthnum%/%day%/%postname%.html </pre> <p>Note that this does not generate static <tt>.html</tt> files. It only adds the <tt>.html</tt> extension, pages are still being dynamically generated. The SEO benefit to this is debatable, but it can be useful should you need to migrate away from WordPress, since the pages can easily be made static and retain their URL structure. </p><p>WordPress versions prior to 2.3 lacked canonical URLs, making <tt>.html</tt> something very beneficial to add (forcing the URL to be canonical). Now it only provides limited, if any SEO benefits (see External Resources for further analysis). </p> <a name="Avoiding_interpretation_as_an_archive_link" id="Avoiding_interpretation_as_an_archive_link"></a><h3> <span class="mw-headline"> Avoiding interpretation as an archive link </span></h3> <p>Note that even though one might never make more than one posting a day, and thus wishes to use e.g., %year%%monthnum%%day%, links so generated will however be interpreted as the archive of all posts for that day. One needs at least %year%%monthnum%%day%%hour% to target an individual post. </p> <a name="See_Also" id="See_Also"></a><h2> <span class="mw-headline"> See Also </span></h2> <ul><li><a href="/web/20091004170946/http://codex.wordpress.org/Linking_Posts_Pages_and_Categories" title="Linking Posts Pages and Categories">Linking Posts Pages and Categories</a> for how to link from one article to another </li></ul> <a name="External_Resources" id="External_Resources"></a><h2> <span class="mw-headline"> External Resources </span></h2> <ul><li> <a href="https://web.archive.org/web/20091004170946/http://www.prelovac.com/vladimir/optimizing-wordpress-permalinks" class="external text" title="http://www.prelovac.com/vladimir/optimizing-wordpress-permalinks">Optimize WordPress Permalinks</a> </li><li> <a href="https://web.archive.org/web/20091004170946/http://www.cypherhackz.net/archives/2007/03/25/beautify-your-urls-with-permalinks/" class="external text" title="http://www.cypherhackz.net/archives/2007/03/25/beautify-your-urls-with-permalinks/">Beautify your URLs with Permalinks</a> </li><li> <a href="https://web.archive.org/web/20091004170946/http://www.emilyrobbins.com/how-to-blog/how-to-configure-wordpress-to-create-search-engine-friendly-urls-for-permalinks-242.htm" class="external text" title="http://www.emilyrobbins.com/how-to-blog/how-to-configure-wordpress-to-create-search-engine-friendly-urls-for-permalinks-242.htm">How to Configure WordPress to Create Search Engine Friendly URLs for Permalinks</a> </li><li> <a href="https://web.archive.org/web/20091004170946/http://perishablepress.com/press/2006/06/14/the-htaccess-rules-for-all-wordpress-permalinks/" class="external text" title="http://perishablepress.com/press/2006/06/14/the-htaccess-rules-for-all-wordpress-permalinks/">The htaccess Rules for all WordPress Permalinks</a> </li><li> <a href="https://web.archive.org/web/20091004170946/http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html" class="external text" title="http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html">URL Rewriting Tutorial</a> — the whats, hows and wherefores. </li><li> <a href="https://web.archive.org/web/20091004170946/http://www.tomrafteryit.net/boost-search-engine-optimisation-seo-using-permalinks/" class="external text" title="http://www.tomrafteryit.net/boost-search-engine-optimisation-seo-using-permalinks/">Boost Search Engine Optimisation (SEO) using Permalinks</a> </li><li> <a href="https://web.archive.org/web/20091004170946/http://www.homebizpal.com/blogging/wordpress/understanding-wordpress-permalinks/" class="external text" title="http://www.homebizpal.com/blogging/wordpress/understanding-wordpress-permalinks/">Understanding WordPress Permalinks</a> </li><li> <a href="https://web.archive.org/web/20091004170946/http://perishablepress.com/press/2008/01/16/comprehensive-htaccess-canonicalization-for-wordpress/" class="external text" title="http://perishablepress.com/press/2008/01/16/comprehensive-htaccess-canonicalization-for-wordpress/">WordPress Permalink Canonicalization using htaccess</a> </li><li> <a href="https://web.archive.org/web/20091004170946/http://perishablepress.com/press/2008/02/06/permalink-evolution-customize-and-optimize-your-dated-wordpress-permalinks/" class="external text" title="http://perishablepress.com/press/2008/02/06/permalink-evolution-customize-and-optimize-your-dated-wordpress-permalinks/">Customize and Optimize Your Dated WordPress Permalinks</a> </li><li> <a href="https://web.archive.org/web/20091004170946/http://www.micronovae.com/ModRewrite/articles/CleanPermalinksWordpress.html" class="external text" title="http://www.micronovae.com/ModRewrite/articles/CleanPermalinksWordpress.html">Clean Permalinks for IIS using .htaccess</a> </li><li> <a href="https://web.archive.org/web/20091004170946/http://chrisjohnston.org/2009/setting-up-a-wordpress-blog-on-lighttpd" class="external text" title="http://chrisjohnston.org/2009/setting-up-a-wordpress-blog-on-lighttpd">The Easiest Lighttpd Rewrite Rule</a> </li><li> <a href="https://web.archive.org/web/20091004170946/http://blog.nix.is/lighttpd-rewrite-rules-for-wordpress" class="external text" title="http://blog.nix.is/lighttpd-rewrite-rules-for-wordpress">URL rewriting with lighttpd</a> </li><li> <a href="https://web.archive.org/web/20091004170946/http://sudhaker.com/web-development/wordpress/wordpress-permalinks-lighttpd.html" class="external text" title="http://sudhaker.com/web-development/wordpress/wordpress-permalinks-lighttpd.html">Permalinks with Lighttpd</a> — using mod_magnet; works on 1.4.2+ </li></ul> <!-- NewPP limit report Preprocessor node count: 130/1000000 Post-expand include size: 1247/2097152 bytes Template argument size: 497/2097152 bytes Expensive parser function count: 0/100 --> <div class="printfooter"> Retrieved from "<a href="https://web.archive.org/web/20091004170946/http://codex.wordpress.org/Using_Permalinks">http://codex.wordpress.org/Using_Permalinks</a>"</div> <div id="catlinks"><div id="catlinks" class="catlinks"><div id="mw-normal-catlinks"><a href="/web/20091004170946/http://codex.wordpress.org/Special:Categories" title="Special:Categories">Categories</a>: <span dir="ltr"><a href="/web/20091004170946/http://codex.wordpress.org/Category:Getting_Started" title="Category:Getting Started">Getting Started</a></span> | <span dir="ltr"><a href="/web/20091004170946/http://codex.wordpress.org/Category:Troubleshooting" title="Category:Troubleshooting">Troubleshooting</a></span> | <span dir="ltr"><a href="/web/20091004170946/http://codex.wordpress.org/Category:UI_Link" title="Category:UI Link">UI Link</a></span></div></div></div> <!-- end content --> </div> <div class="col-2"> <ul class="submenu"> <li id="n-mainpage"><a href="/web/20091004170946/http://codex.wordpress.org/Main_Page">Home Page</a></li> <li><a href="/web/20091004170946/http://codex.wordpress.org/WordPress_Lessons">WordPress Lessons</a></li> <li><a href="/web/20091004170946/http://codex.wordpress.org/Getting_Started_with_WordPress">Getting Started</a></li> <li><a href="/web/20091004170946/http://codex.wordpress.org/Working_with_WordPress">Working with WordPress</a></li> <li><a href="/web/20091004170946/http://codex.wordpress.org/Blog_Design_and_Layout">Design and Layout</a></li> <li><a href="/web/20091004170946/http://codex.wordpress.org/Advanced_Topics">Advanced Topics</a></li> <li><a href="/web/20091004170946/http://codex.wordpress.org/Troubleshooting">Troubleshooting</a></li> <li><a href="/web/20091004170946/http://codex.wordpress.org/Developer_Documentation">Developer Docs</a></li> <li><a href="/web/20091004170946/http://codex.wordpress.org/About_WordPress">About WordPress</a></li> </ul> <h3>Codex Resources</h3> <ul class="submenu"> <li id="n-portal"><a href="/web/20091004170946/http://codex.wordpress.org/Codex:Community_Portal">Community portal</a></li> <li id="n-currentevents"><a href="/web/20091004170946/http://codex.wordpress.org/Current_events">Current events</a></li> <li id="n-recentchanges"><a href="/web/20091004170946/http://codex.wordpress.org/Special:Recentchanges">Recent changes</a></li> <li id="n-randompage"><a href="/web/20091004170946/http://codex.wordpress.org/Special:Randompage">Random page</a></li> <li id="n-help"><a href="/web/20091004170946/http://codex.wordpress.org/Help:Contents">Help</a></li> </ul> </div> </div> </div> <div id="footer"> <div class="wrapper"> <p> <a href="https://web.archive.org/web/20091004170946/http://wordpress.org/report-bugs/">Report a Site Bug</a> | <a href="https://web.archive.org/web/20091004170946/http://wordpress.org/about/privacy/">Privacy</a> | <a href="https://web.archive.org/web/20091004170946/http://wordpress.org/about/gpl/">GPL</a> | <a href="https://web.archive.org/web/20091004170946/http://browsehappy.com/">Browse Happy</a> | <a href="https://web.archive.org/web/20091004170946/http://wordpress.org/development/feed/" class="rsslink">WordPress Updates RSS</a> </p> <h6>Code is Poetry</h6> </div> </div> </body> </html> <!-- user: NULL --> <!-- FILE ARCHIVED ON 17:09:46 Oct 04, 2009 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 03:08:23 Feb 27, 2025. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 0.464 exclusion.robots: 0.025 exclusion.robots.policy: 0.016 esindex: 0.009 cdx.remote: 4.463 LoadShardBlock: 173.442 (3) PetaboxLoader3.datanode: 172.905 (4) PetaboxLoader3.resolve: 115.04 (2) load_resource: 130.631 -->