RSS Feed for This PostCurrent Article

How to remove index.php in Wordpress permalink

I am not sure whether you guys occur this problem or not. But I myself do. I am on a Linux based web hosting, I am not sure what’s the problem is, I’ve already solve it so I decided to share it with you guys.

When you are setting permalink in Wordpress blog. You will find 4 options, 3 is preset and the 4th is custom.

The first option is ugly permalink :

http://inicholas.net/?p=123

The second and third one is better :

  • http://inicholas.net/index.php/2007/09/07/sample-post/
  • http://inicholas.net/index.php/archives/123

Do you notices the index.php at the permalink there? At first, I thought it would be edited and deleted at the custom field. But then, if without the index.php, the permalink to all post will be directed to a 404 Error Page / Page Not Found.

I search and search and search the web and finally found a solution by editing/making a .htaccess file.

  1. Open Notepad.
  2. Copy and paste this codes# BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
  3. Save as any file name.
  4. Then rename it to .htaccess .
  5. Last step, you can now delete the index.php at the custom field area of permalink setting.

Enjoy and good luck.

Trackback URL

  1. 3 Comment(s)

  2. By Kay on Sep 8, 2007 | Reply

    I never occur this problem. Maybe there’s some mistakes when u install WP i think…

  3. By stephen on Sep 23, 2007 | Reply

    yup, i’m running into this same issue.

    i recently upgraded hosting on godaddy.com. I went from their deluxe basic hosting, to their virtual dedicated hosting.

    The new environment is windows 2003 using Plesk for management (iis 6, php 4.7, mysql).

    My blog http://www.killersixtysix.com

    (currently messing with forwarding so the address may not work, if not, try http://www.killersixtysix.com/wp)

    Anyway, my question is, will this solution work on a windows 2003 server?

    somewhere i read that the mod_rewrite was an apache only thing…

    ==
    looks like this site may contain (or link to) the solution for people in my situation…

    http://codex.wordpress.org/

    ==

    looks like it killed my link…

    here we go

    http://codex.wordpress.org/Using_Permalinks#Creating_Rewrite_Rules_.28.htaccess.29

  4. By Nicholas Chan on Sep 23, 2007 | Reply

    For your information, AFAIK, this is for people who is hosting on a Linux Server. For Windows Server, you can try the guide but I cannot be sure that it will works or not.

Post a Comment