Configuring permalinks and URL rewriting for Wordpress under IIS

Rewriting the URL and setting the permalinks on the wordpress on IIS can now be achieved by wp-url-rewriting.dll. Copy the dll into the windows folder of the server. In IIS MMC snap-in, register the dll using the ISAPI filters. After successful registration, configure the permalinks in wordpress using the wordpress dashboard.

Download dll here

using the following paging function to resolve the pagination issues.
function get_pagination($range = 4){
// $paged – number of the current page
global $paged, $wp_query;
// How much pages do we have?
if ( !$max_page ) {
$max_page = $wp_query->max_num_pages;
}
// We need the pagination only if there are more than 1 page
if($max_page > 1){
if(!$paged){
$paged = 1;
}
// On the first page, don’t put the First page link
if($paged != 1){
echo “<a href= . get_pagenum_link(1) . > First </a>”;
}
// To the previous page
previous_posts_link(’ « ‘);
// We need the sliding effect only if there are more pages than is the sliding range
if($max_page > $range){
// When closer to the beginning
if($paged < $range){
for($i = 1; $i <= ($range + 1); $i++){
echo “"<a href= . get_pagenum_link($i) . >$i</a>”;
}
}
// When closer to the end
elseif($paged >= ($max_page – ceil(($range/2)))){
for($i = $max_page – $range; $i <= $max_page; $i++){
echo "<a href= . get_pagenum_link($i) . >$i</a>”;
}
}
// Somewhere in the middle
elseif($paged >= $range && $paged < ($max_page – ceil(($range/2)))){
for($i = ($paged – ceil($range/2)); $i <= ($paged + ceil(($range/2))); $i++){
echo "<a href= . get_pagenum_link($i) . >$i</a>”;
}
}
}
// Less pages than the range, no sliding effect needed
else{
for($i = 1; $i <= $max_page; $i++){
echo "<a href= . get_pagenum_link($i) . >$i</a>”;
}
}
// Next page
next_posts_link(’ » ‘);
// On the last page, don’t put the Last page link
if($paged != $max_page){
echo ” <a href=get_pagenum_link($max_page)> Last </a>”;
}
}
}

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Post to Twitter Tweet This Post

 

Comments

No comments so far.
  • Leave a Reply

     
    Your gravatar
    Your Name
     
     
     
     
     
 

Seattle, WA USA

The Plazas
10800 NE 8th St. Suite 802,
Seattle, WA 98004
+1 425 502 6542

Mumbai, India

1B Goldline Business Center
New Link Road Chincholi Bunder,
Malad (W) Mumbai 400064. India
+91 9820787679

Singapore

23/F Chevron House
30 Raffles Place
Singapore 048622
+65 64089704