Linux Apache2: Mod_rewrite for WordPress


So I’ve been having all kinds of issues with getting Word-Press “permalinks” working. I could’ve sworn that that I had my “.htaccess” file setup properly, my Word-Press install seemed to be working just fine, and everything else on the server worked. So what to do?

 


Google.

 

First off, if you’re like me, you already installed Apache like this:

apt-get install apache2

 
 

You should already have Apache’s mod_rewrite installed on your box. If so, it will found in “/usr/lib/apache2/modules”

 
 

Now, go into your “mods-enabled” directory and create a rewrite file.

cd /etc/apache2/mods-enabled
touch rewrite.load
sudo nano rewrite.load

 
 

Now paste this following line, then save and close this file:

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

 
 

Now we need to make sure that our Apache config is setup properly:

sudo nano /etc/apache2/sites-available/default

 
 

Find the following:

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

 
 

Now, change the “AllowOverride” from “None” to “ALL”

Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all

 
 

and finally restart Apache:

/etc/init.d/apache2 restart

 
 

Now you can go into your Word-Press Administration area and change your “Permalinks” to be whatever you’d like them to be! 🙂

 
 

Enjoy!

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)