{"id":3667,"date":"2013-12-07T11:24:21","date_gmt":"2013-12-07T11:24:21","guid":{"rendered":"http:\/\/www.webputzer.com\/?p=3667"},"modified":"2013-12-20T20:04:25","modified_gmt":"2013-12-20T20:04:25","slug":"configure-permalinks-on-iis","status":"publish","type":"post","link":"http:\/\/www.webputzer.com\/?p=3667","title":{"rendered":"Configure Permalinks on IIS"},"content":{"rendered":"<h3>Using Permalinks<\/h3>\n<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 \u2014 hence permalink.<\/p>\n<h3>Permalink Types<\/h3>\n<p>There are three basic types of WordPress permalinks:<\/p>\n<ol>\n<li> Default: &#8220;Ugly&#8221;<br \/>\nThe default links, which looks like this:<br \/>\nhttp:\/\/example.com\/?p=N<br \/>\nwhere N is the Post ID number. It works on all server environments, but it doesn&#8217;t look as nice as some of the other options.<\/p>\n<li> mod_rewrite: &#8220;Pretty Permalinks&#8221;<br \/>\nUsing mod_rewrite or lighttpd you can produce much nicer permalinks (see Pretty Permalinks). There are many different formats, but the most common, and most versatile looks like:<br \/>\nhttp:\/\/example.com\/category\/post-name\/<br \/>\nor  http:\/\/example.com\/year\/month\/day\/post-name<br \/>\nSome people eliminate some or all of the date elements (day, month, year) to have a shorter permalink format.<br \/>\nPretty permalinks are available under:<br \/>\nApache web server with the mod_rewrite module<br \/>\nMicrosoft IIS 7+ web server with the URL Rewrite 1.1+ module and PHP 5 running as FastCGI<br \/>\nMicrosoft IIS 6+ using ASAPI_Rewrite<br \/>\nLighttpd using a 404 handler or mod_rewrite (see See Also)<\/p>\n<li> PATHINFO: &#8220;Almost Pretty&#8221;<br \/>\nPATHINFO permalinks look very much like mod_rewrite permalinks but for one exception: they have \/index.php inserted before them, like so:<br \/>\nhttp:\/\/example.com\/index.php\/yyyy\/mm\/dd\/post-name\/<br \/>\nOtherwise, they are the same as the &#8220;pretty&#8221; mod_rewrite permalinks, and are similarly flexible. Anything that mod_rewrite permalinks can do, PATHINFO permalinks can do, with the help of that \/index.php part.  There is a helpful plugin that displays the type of permalinks being used and detailed information on the internal rewrite rules used by WordPress.\n<\/ol>\n<h3>Choosing your permalink structure<\/h3>\n<p>In the Settings > Permalinks panel (Options > Permalinks before WordPress 2.5), you can choose one of the &#8220;common&#8221; structures or enter your own in the &#8220;Custom structure&#8221; field using the structure tags.<br \/>\nPlease note: You never, ever put your site url in the permalinks slot. You must use one of the structure tags,<br \/>\nor a combination of tags only.<\/p>\n<p>%year% &#8211; The year of the post, four digits, for example 2004<br \/>\n%monthnum% &#8211; Month of the year, for example 05<br \/>\n%day% &#8211; Day of the month, for example 28<br \/>\n%hour% &#8211; Hour of the day, for example 15<br \/>\n%minute% &#8211; Minute of the hour, for example 43<br \/>\n%second% &#8211; Second of the minute, for example 33 <br \/>\n%postname% &#8211; A sanitized version of the title of the post (post slug field on Edit Post\/Page panel).<br \/>\nSo &#8220;This Is A Great Post!&#8221; becomes this-is-a-great-post in the URI (see Using only %postname%).<br \/>\nStarting Permalinks with %postname% is not recommended, for performance reasons.<br \/>\n%post_id% &#8211; The unique ID # of the post, for example 423<br \/>\n%category% &#8211; A sanitized version of the category name (category slug field on New\/Edit Category panel). Nested sub-categories appear as nested directories in the URI. Starting Permalinks with %category% is strongly not recommended for performance reasons.<br \/>\n%tag% &#8211; A sanitized version of the tag name (tag slug field on New\/Edit Tag panel). Starting Permalinks with %tag% is strongly not recommended for performance reasons<br \/>\n%author% &#8211; A sanitized version of the author name. Starting Permalinks with %author% is strongly not recommended for performance reasons<\/p>\n<h3>Using &#8220;Pretty&#8221; permalinks (IIS)<\/h3>\n<p><strong>Permalinks without mod_rewrite<\/strong><\/p>\n<p>&#8220;Pretty&#8221; permalinks usually require <strong>mod_rewrite<\/strong>, and IIS (common on Windows servers) does not support mod_rewrite. (If you are using Apache 2.0.54, on Windows, mod_rewrite may work, provided it is enabled in apache\\conf\\httpd.conf.)  If you are using IIS 7 and have admin rights on your server, you can use Microsoft&#8217;s URL <strong>Rewrite Module<\/strong> instead. Though not completely compatible with mod_rewrite, it does support WordPress&#8217;s pretty permalinks. Once installed, open the web.config file in the WordPress folder and add the following rule to the system.webServer element<\/p>\n<pre style=\"font-size: 11px;\">\r\n&lt;rewrite>\r\n    &lt;rules>\r\n        &lt;rule name=\"Main Rule\" stopProcessing=\"true\">\r\n            &lt;match url=\".*\" \/>\r\n            &lt;conditions logicalGrouping=\"MatchAll\">\r\n                &lt;add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" negate=\"true\" \/>\r\n                &lt;add input=\"{REQUEST_FILENAME}\" matchType=\"IsDirectory\" negate=\"true\" \/>\r\n            &lt;\/conditions>\r\n            &lt;action type=\"Rewrite\" url=\"index.php\/{R:0}\" \/>\r\n        &lt;\/rule>\r\n    &lt;\/rules>\r\n&lt;\/rewrite><\/pre>\n<p>&nbsp;<\/p>\n<h3>Download info and files&#8230;<\/h3>\n<p>There&#8217;s a <a href=\"http:\/\/www.iis.net\/learn\/extensions\/url-rewrite-module\/enabling-pretty-permalinks-in-wordpress\">full installation guide<\/a> on the IIS site. You can also download a copy of this page, a copy of the Microsoft page, and the required files (for either x86 or x64) <a href=\"http:\/\/www.webputzer.com\/wp-content\/uploads\/2013\/12\/mod_rewrite.zip\">from me, here.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using Permalinks 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3630,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"h5ap_radio_sources":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3667","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts\/3667","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3667"}],"version-history":[{"count":0,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts\/3667\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/media\/3630"}],"wp:attachment":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3667"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}