mod_rewrite with Fedora 10 and ISPConfig for WordPress

This relates to Fedora 10 and ISPConfig 3.0.1 set up as described in this HowtoForge post

One of my colleagues recently got interested in offering our clients WordPress as a content management system, so he’s been trying it out.
Yesterday he found out that if he wanted to change the permalink style in WordPress he needed write access to .htaccess, which he didn’t have because the user rights haven’t been set up very well there.
So I gave him write access by using

chown apache:apache .htaccess

Unfortunately this resulted in a 500 Interal Server Error.
Looking at the error log for the website I tried this for it let me know that RewriteEngine directives were not allowed in the .htaccess.
Since I didn’t want to mess with the base configurations of ISPConfig I started looking around for other options. Eventually I found that I had to add something similar to this to the Apache directives field under options under the website’s settings

<IfModule mod_rewrite.c>  <Directory /var/www/[sitename]/web/>    Options +FollowSymLinks    RewriteEngine On    RewriteBase /    RewriteCond %{REQUEST_FILENAME} !-f    RewriteCond %{REQUEST_FILENAME} !-d    RewriteRule . /index.php [L]  </Directory></IfModule>

Of course [sitename] should be replaced with the name of your website.

It all works after I restarted the apache server myself, but I do not know if that is completely necessary. Also it might take a few seconds before ISPConfig finishes editing the configuration file.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s