Wednesday, April 22, 2015

mod_rewrite woes...

I'm having a problem with WordPress that is preventing my advance on another website. In short, I can't get "Permalinks" to work in any but the "Default" mode. Any other choice results in the same form:
which results in the dreaded 404 error.

Permalinks are features of WordPress that let you choose the format of the links in the pages that you post. You can choose among Day and Name, Month and Name, Numeric, or Post name. Each of these should provide a different format. But choosing any of these renders the same result: Post name in the form above.

Use of any but Default requires:

Installation and activation of Module rewrite (mod_rewrite) in the server.
Our server is /etc/apache2 version 2.4 and is up to date.
We have searched for the module and found it as /usr/lib64/apache2/

It also exists in the Apache Server Module list with the Status of Enabled.
We have tested it with and its The latter says it is not being used, despite being Enabled.
So how else to tell the server to use it other than enabling it?

Various other settings in /etc/apache2/httpd.conf, other subordinate .conf files, and the .htaccess files in the various server directories. In particular, we need:
+ A directory section in httpd.conf referring to the entire server path

Options FollowSymLinks
AllowOverride All
Require all

+ In WordPress's home directory, the FollowSymLinks option enabled.
Done, in the section of httpd.conf as well as in the local .htaccess above the WordPress section.

Checking the logs:
Explicitly set LogLevel alert rewrite:trace3 to enable logging rewrite events.

cat error_log|grep 'rewrite' returns no recent rewrite issues.

But there is an implication that FollowSymLinks and SymLinksIfOwnerMatch must both be on. We had the former already, add the latter and restarted the server: No change.

I found another string to follow, perhaps tomorrow:

It's nice to know I am not alone.

No comments: