As promised in the previous post, here’s what you need to do to get clean URLs for WP in IIS.

  1. Create a new PHP file wp-404-handler.php in the root folder (in case you are not sure, this is the folder that has “wp-admin”, “wp-content”, “wp-includes” sub folders and bunch of other php files ) and copy paste the following code in it.<?php
    $qs = $_SERVER['QUERY_STRING'];
    $pos = strrpos($qs, ‘://’);
    $pos = strpos($qs, ‘/’, $pos + 4);
    $_SERVER['REQUEST_URI'] = substr($qs, $pos);
    $_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
    include(’index.php’);
    ?>
  2. Open IIS manager – Expand local computer – Expand Web Sites – Right click on your site – Click Properties – Click Custom Errors tab – Select 404. (See image below)IIS Website Custom errors tab
  3. Click Edit – Set Message Type to “URL” and URL to “/” (See image below)404 edit properties
  4. Click OK.
  5. Now login to your WordPress admin control panel. Click Settings and click Permalink (wp-admin/options-permalink.php)
  6. Select “Custom structure” and set the text to “/%year%/%monthnum%/%day%/%postname%/”
  7. And you are done! Your site should now have clean URLs like this site does.

New domain. New site.

April 1st, 2008

A few days back i bought a new domain name (see URL) inspired by Matthew Mullenweg’s domain, founding developer of WordPress.

I know. i know. Vanity is not really my thing. But hey… sometimes you just gotta give in. :) (Did that rhyme, btw?)

So anyways, a new (and really cool) domain name deserved a new site i thought. And i started hunting for some cool Wordpress template and after a lot of reviewing, decided to use PortraitPress theme by Magnus Jepson.

I wish i was as creative as the Visual Designers i work with, that design and build their site’s theme (mostly on blog engines like Wordpress or textpattern or Expression Engine) from scratch.

But i’m not (i’m “just” a programmer) and as long as there are kind souls like Magnus, that don’t mind sharing their beautiful work for free, i don’t mind using it either.

Take a look around and let me know what you think.

And Oh..oh… before i forget, note the clean URLs. Getting Wordpress to strip off the “index.php” was a big pain in the butt in the previous versions. For example, “http://example.com/index.php/2008/04/01/sample-post/“. And since almost all of the fixes they recommended, involved editing the .htaccess file which doesn’t apply to IIS, i never got it to work.

But this time, the site has clean URLs, for eg: http://giri.sh/contact and http://giri.sh/about, even though it is hosted on the same environment – IIS on Windows 2003 server. I’ll post a tutorial with screenshots on how to do it.

By the way, if you are reading this from your RSS reader, don’t bother updating your feed URL. I’ve been using feedburner to publish my feeds and i have updated it already. But please visit the site and lemme know what you think.

Step 1: Download the plugins here. gg_linkxfn_v1.0.txt (admin side) gg_linklistxfn_v1.0.txt Since Textpattern is a PHP based CMS, the plugins are written in PHP as well. But these text plugin files don’t have any plain PHP code in it. The code is actually compiled into a chunk of base64-encoded text, to allow for easy installation and minimize corruption problems.

Step 2: Go to your textpattern admin interface usually yourdomainname.com/textpattern/index.php assuming you just did the simple basic installation. Here’s what you should see now. start

Step 3: Now click on the admin tab admin

Step 4: Click on plugins tab plugins

Step 5: Now in the textarea beside “Install plugin”, copy paste the text from the gg_linkxfn_v1.0.txt (let’s install the admin side plugin first) and click “Upload”. Textpattern will decode the text for you and spit out the plain PHP code, and then ask you whether you are ready to install it. install

Step 6: Click Install. Now you should be back to the list of plugins under the plugin tab. On the gg_linkxfn plugin row, click on “No”(under the “active” column) to change it to “Yes”, to enable the plugin. enable

Step 7: That’s it you are done! Now to see the plugin in action. Click on the content tab. You should see a new tab named “linkxfn” under the sub tabs. Click on the new tab. linkxfn

Step 8: There ya go! All set. Now you can choose your options from the fields, build the relation tag and see it in the “xfn” text area. Hit Save and you just have saved the values that will be populated in the “rel” attribute when you display the links using gg_linklistxfn plugin.

Step 9: Now repeat steps 1 to 7 to install and enable the gg_linklistxfn plugin.

Step 10: Here’s how you use it in your forms or pages.

<txp:if_category>
<txp:gg_linklistxfn form="waw_links" columns="1"
columnwraptag="ul" columnclass="alllinks" listwraptag=""
listclass="" headless="1" headwraptag="h3" argname="c"
category="Friends-and-Colleagues" />
<txp:else />
<txp:gg_linklistxfn form="waw_links" columns="1"
columnwraptag="ul" columnclass="alllinks" listwraptag=""
listclass="" headwraptag="h3" headless="1"
category="Friends-and-Colleagues"/>
</txp:if_category>

Since this plugin is an extension of Manfre’s mem_glinklist plugin, you can just read how to configure it from his help page. There are no new parameters to add or nothing different about how you use it.

Step 11. Here’s a demo. Right click on any link on blogroll there and click on properties. You should a relation name-value pair. Check out the screenshot below. properties

UPDATE: Step above will not work anymore as this site has been upgraded since the time this plugin was written. It runs on Wordpress now and hence doesn’t support any textpattern plugins.

Step 12. Most important of all…..ENJOY!

GirishG.com revamped

November 7th, 2005

Finally…even though half baked, i updated my website with its new looks. Like i said, not completely done yet, but the way i was procrastinating it, seemed like i’d never make it live.

Probably gonna get beaten up for the color combination i’ve chosen (i suck at picking the right colors) , but heyy….that’s what criticism is for. If you can suggest a better combo, i’m all ears.

I bought GirishGangadharan.com and redirected GirishG.com to the new one. But i think the email girish AT girishg DOT com should still work since i get one free email address for registering the domain even though i cancelled the hosting with GoDaddy.

Anyways, check out my “all new” website and lemme know what you think.

Till next time,

Happy Living.