# Apache mod_rewrite not working



## finkyfeke (Aug 25, 2008)

Hi,
I'm using WordPress on an Ubuntu/Apache/MySQL/PHP server. For the "Pretty Permalinks," it uses mod_rewrite. However, it shows a 404 error when one of these links is visited.

Wordpress generated its own .htaccess file, so it should be correct, but I'll post it anyway:


```
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /enl/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /enl/index.php [L]
</IfModule>
# END WordPress
```
It should turn /enl/?p=123 into /enl/categories/post-name but it isn't doing anything. I even tried restarting the server, but still nothing.

I'm sure that mod_rewrite is enabled; it shows up in phpinfo() under apache2handler Loaded Modules.

Any help is much appreciated.
Thanks a lot in advance,
--Richard


----------



## wmorri (May 29, 2008)

Hi,

The fastest way to make sure that mod_rewrite is enabled, is to check in the /etc/apache2/mod_available directory. If you find that you need to enable it then try using this command:


```
a2enmode rewrite
```
To make sure that rewrite is enabled use the command:


```
sudo apache2ctl -l
```
For more help with this see the thread How to enable mod_rewrite in Ubuntu server??

Cheers!


----------

