Skip to main content

remove index.php from wordpress on win2003 shared hosting

No need to install any ISAPI filter to remove the index.php from WordPress permalinks.No need of .htaccess file..Use these simple steps to WordPress Permalinks in IIS 6.0 using Custom 404 Redirect for Windows Shared hosting/manas hosting or any windows shared hosting.When you run wordpress on IIS server your permalinks have to include the prefix /index.php/ which looks ugly and is totally unnecessary.If you have these requirements as follow: 

a.IIS for Windows Shared Hosting
b.WordPress Site
c.Access to change your 404 error page with your web hosting.

This can be remove by following simple steps.

1Once installed wordpress blog on your site you’ll want to log into the admin section and select options and then select permalinks. Set your permalinks as you wish.

2. Then You’ll create a new text file and name it "404-error.php". In this text file you’re going to include the text:


<?php
// This is the default file for the site. Usually index.php
$default = 'index.php';

// The name of this file.
// Set this value for the URL in Custom Error Properties of your website in IIS.
// Goto: IIS Manager > Websites > [Site Name] > Properties > Custom Errors >
// 404 & 404;2 & 404;3 > URL (Requires a '/' prefix in IIS).
$thisfile = '404-error.php';

$_SERVER['ORIG_PATH_TRANSLATED'] = str_replace($thisfile, $default, $_SERVER['ORIG_PATH_TRANSLATED']);
$_SERVER['SCRIPT_FILENAME'] = str_replace($thisfile, $default, $_SERVER['SCRIPT_FILENAME']);
$_SERVER['ORIG_PATH_INFO'] = str_replace($thisfile, $default, $_SERVER['ORIG_PATH_INFO']);
$_SERVER['SCRIPT_NAME'] = str_replace($thisfile, $default, $_SERVER['SCRIPT_NAME']);
$_SERVER['PHP_SELF'] = str_replace($thisfile, $default, $_SERVER['PHP_SELF']);
$_SERVER['PATH_INFO'] = false;

$qs =& $_SERVER['QUERY_STRING'];
$ru =& $_SERVER['REQUEST_URI'];
$pos = strrpos($qs, '://');
$pos = strpos($qs, '/', $pos + 4);
$_SERVER['URL'] = $ru = substr($qs, $pos);
$qs = trim(stristr($ru, '?'), '?');

// Required for WordPress 2.8+
$_SERVER['HTTP_X_ORIGINAL_URL'] = $ru;

// Fix GET vars
foreach ( $_GET as $var => $val ) {
  if ( substr($var, 0, 3) == '404') {
    if ( strstr($var, '?') ) {
      $newvar = substr($var, strpos($var, '?') + 1);
      $_GET[$newvar] = $val;
    }
    unset($_GET[$var]);
  }
  break;
}
include($default);
?>
then Upload 404-error.php into the root directory of your blog.

3.Set a custom 404 redirect to “/404-error.php”. It is important that the type of redirect is set to URL.
You can change this directly from within IIS by selecting Properties -> Custom Errors. Select 404. Edit. Set Message Type to URL (you have the option of File, URL or Default). Set it to /404-error.php.

4. That's It done.Check your blog.It will working Fine.

Google Search Keywords:Remove index.php wordpress, remove index.php on shared hosting,php url host,godaddy wordpress install,installing wordpress godaddy,wordpress install godaddy,wordpress custom urls,installing wordpress on iis,godaddy iis,wordpress custom url,url rewrite in wordpress
htaccess url,,wordpress rewrite url,htaccess rewriting,wordpress isapi rewrite,change wordpress url,windows iis,wordpress url rewrite,wordpress url rewriting,iis rewrite rule,isapi rewrite wordpress

Comments

  1. I am running Manashosting services, it show index.php in the url http://assuredreturnproperties.com/index.php/gurgaon/

    I dint got 3rd Step, where i can IIS

    ReplyDelete
  2. @GrowingBricks

    go to the webspace tab in control panel, then click on WebSite Configuration. it will display some tab in right side, click on Error Documents. then click on 404 in list it will display the following windows.

    ReplyDelete
  3. How's your webmaster tools with this solution? How's the 404 error pages? Do they work?

    ReplyDelete
  4. @Rod Ferris

    yes of-course this work pls check this site

    www.dotnetspider.in

    a wordpress site on windows shared hosting.

    ReplyDelete
  5. Thanks a lot Brother......
    I solve it
    http://assuredreturnproperties.com/gurgaon/

    God Bless you

    ReplyDelete
  6. Is there a way to do this with Mac? I don't use IIS. Thanks.

    ReplyDelete
  7. Thanks this worked but now the home page returns error 404 instead of the selected page in settings/reading

    ReplyDelete
  8. Hey, I worked this out, but I am getting a message "the data is invalid" So, I know the custom 404 error is getting redirected, but something else is not right.

    ReplyDelete
  9. Just wondering if this approach has any implications on SEO ?

    ReplyDelete
  10. Great work www.mintywebs.com thanks!

    ReplyDelete
  11. Worked like a charm!

    ReplyDelete
  12. Yes! Finally ѕomeone writes about seoo hаrvard.



    Also νisit my websitе ... seo's

    ReplyDelete
  13. There's a flaw with this - your wegbserver will now response to every duff request (domain.com/reallyRubbishUrl/) with a 200, not 404, status code.
    Does anyone have a cure of that please?

    ReplyDelete
  14. I wasted more than 6-8 hours trying to find a solution and yours is the only solution which is easiest to implement and has worked well for me except this home page issue. Can you please help resolve this issue for me. I have lost patience to do any further research or try any other solutions.

    Please help at the earliest.

    ReplyDelete
  15. This article is brimming with information about wordpress maintenance for more like this. I have additionally discovered an article anybody can check for more data WordPress Maintenance , It was knowingly more instructive. You may discover more insights regarding it here.

    ReplyDelete

Post a Comment

Popular posts from this blog

Download SCERTUP BTC 2011 Application Form

Note : Professional Courses Student can also now apply for UP BTC 2011 and date extended. The SCERT of UP was established at Lucknow in 1981 as an apex government organization at the state level. The State Council of Educational  Research  &  Training , U.P., is providing academic support to the District Primary Education Program intended primarily to accelerate the processes of pedagogical renewal in the state.   The Utter Pradesh Education Board Basic Training Certificate or B.T.C Application Form 2011 is now available for download on the Uttar Pradesh State Council of Educational Research & Training (SCERT) official website. Pre-Service Training * Training of Special B.T.C. Trainees. Training Urdu Special B.T.C. in process * Training of Shiksha Mitras, EGS/ AIE Instructors & Literacy functionaries. * Pre-service Training for physical Education and nursery training also being conducted. The thrust areas include  (a) development of curriculum, r

UP TET 2011 Exam Application,UPTET 2011 Result | UPTET 2011 Revised Result

UPTET 2011 Result | UPTET 2011 Revised Result | UPTET 2011 Updated Result |Board of High School and Intermediate Education Uttar Pradesh, Allahabad UP TET Advertisement 2011 and Exam Detail/Admit Card/Call Letter Download UP TET 2011 FORM & DETAILS  GET LATEST DETAIL ABOUT 72825 Primary Teacher Merit List UP TET 2011 Application form submission last date is 18-Oct-2011.Forms will be distributed from PNB bank all over UP.According to latest news Appearing B.Ed student also eligible for TET exam 2011 so they can also submit their forms to concern District.There is no requirement for Rojgar Registration No and Bank receipt within the application form.UP TET 2011 exam results will be avail on http://www.uptet2011.com . Now you can easily get Application from from the P.N.B bank Branches. UPTET 2011 Result | UPTET 2011 Revised Result | UPTET 2011 Updated Result |  Board of High School and Intermediate Education Uttar Pradesh, Allahabad