Posts Tagged mod_rewrite

Enabling Mod_Rewrite in Apache 2.x

Trying to enable mod_rewrite in Apache 2? Check these things.

  1. In your httpd.conf file (probably in/etc/httpd/conf/), search for the line:
    LoadModule rewrite_module modules/mod_rewrite.so
    Ensure there is no pound sign (#) in front of this line.
  2. Search for AllowOverride and ensure it is set to All.
  3. Search for AccessFileName. If you do not find a line that says:
    AccessFileName   .htaccess
    You need to add it.
  4. Restart Apache (service httpd restart OR /etc/init.d/httpd restart)

That should be it.

,

4 Comments

WordPress, IIS, permalinks, and 404′s oh my!

Installing WordPress on IIS is easy, but getting it working perfectly is more difficult.

Without extra work, you cannot achieve nice looking perma links like:

http://clifgriffin.com/2008/10/02/some-post-title

Instead, you have to use something like:

http://clifgriffin.com/index.php?p=95

or slightly better,

http://clifgriffin.com/index.php/2008/10/02/some-post-title

Unfortunately, search engines don’t like either of the above.

In an effort to fix this, I began searching for the easiest way to fix this. There are several ways you can do it.

  1. Install ISAPI_Rewrite Professional (Lite version doesn’t work)
  2. Use a custom 404 page. (works well, but kind of a hack)
  3. Use WordPress URL Rewrite.

Both 1 and 3 emulate mod_rewrites functionality. 3 is custom written to support only wordpress.

I tried the custom 404 page. It worked for the most part but some plugins seemed to have troubles with it (it manually sets the POST information and then includes the index page…very much a hack). I asked my host to install ISAPI_Rewrite, but they weren’t ready to shell out $99 on my behalf.  So,  I finally asked them to install WordPress URL Rewrite.  In a couple of hours they obliged me and everything is working fine.

The only problem I’m having now is that my custom 404 page (built into the wordpress theme) isn’t working currently. I’ve posted on the binaryfortress forums and hope to resolve this soon.

In such time I will update this post. In the meantime, these are the 3 most reliable methods of doing this.  I hope this gives you a jump start.

, , , , ,

11 Comments