Wordpress Permalinks Not Working

If we're using Apache, there are 2 ways to fix this:

1. Allow Wordpress to edit an .htaccess file in the WP root directory.

2. Add a Directory section to the domain's Virtual Host block.


The .htaccess Method

Using this method, Wordpress needs to have permission to edit the .htaccess file in the root-Wordpress directory:

Create a blank .htaccess file:

Code
cd /web/vhosts/example.com/htdocs/
touch .htaccess


Make Apache read the .htaccess file. Edit the conf file for the target domain:

Code
vi /etc/httpd/vhosts/example.com


Add a Directory directive:
Code
<VirtualHost *:80>

    ServerName example.com
    ServerAlias www.example.com

    <Directory /web/vhosts/example.com/htdocs/>
        Options FollowSymLinks
        AllowOverride All
    </Directory>

</VirtualHost>

Virtual Host Directive

Using this method, we can just add all of the necessary directives in the Virtual Host block in the Apache config file:

Code
<VirtualHost *:80>

    ServerName example.com
    ServerAlias www.example.com

    DocumentRoot /web/vhosts/example.com/htdocs

    <Directory /web/vhosts/example.com/htdocs/>
        Options FollowSymLinks
        <IfModule mod_rewrite.c>
            RewriteEngine On
            RewriteBase /
            RewriteRule ^index\.php$ - [L]
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule . /index.php [L]
        </IfModule>
    </Directory>

</VirtualHost>



The Captian
Today they call you "crazy". Tomorrow they call you "ahead of your time."
Global Skywatch Learn about Chemtrails - You're breathing them now!
OnlyTheBestHerbs.com World-class supplements
Mercury Talk Why you are sick.
OneUp Domains Domains, Hosting, Email
1-800-358-4278 (U.S. & Canada)