I'm trying to change the permalinks in Wordpress, so the URL uses the post-names instead.

I've tried to modify the httpd.conf directly as below but Apache doesn't seem to be parsing the URL. I keep getting page not found.

I can't see any attempts to redirect whatsoever as the rewrite logs are empty. I have tried several over rewrite conditions that is known to work outside of the tag but the logs are still empty.

<Directory "/var/www/user1/example.com/public_html">

    Options +Indexes FollowSymLinks +ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from All

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]


It seems the RewriteRule and RewriteCond isn't working when placed in the tag as when I move these directives outside the tag, apache does parse the URL correctly and page's does have some contents. Hoever, the displayed pages no longer has any structure; it appears certain css files did not get loaded or possible the rewrite performed was done incorrectly.

Also I've checked the rewrite logs and noticed that the parameter RewriteBase passes through the request without doing anything: - - [28/Jun/2014:15:52:00 +1000] [dev.ebizimate.com/sid#7f6cbbab7738 [rid#7f6cbbd07c38/initial] (2) init rewrite engine with requested uri /blog/ - - [28/Jun/2014:15:52:00 +1000] [dev.ebizimate.com/sid#7f6cbbab7738][rid#7f6cbbd07c38/initial] (1) pass through /blog/

Any help would be greatly appreciated. Thank you.


It appears the reason that the rules wasn't apply was due to the options in the tags. /var/www/ is symlink to the the /home directory and as a result of the option FollowSymLinks not being set correctly, some of the contents weren't getting loaded or loaded at all (depending on where the rewrite cond/rules were placed).

From reading the options allowed in Apache docs, you either have to specify a + or - :

Note Mixing Options with a + or - with those without is not valid syntax, and will be rejected during server startup by the syntax check with an abort.

So all I needed to was modify the following entry:

Options +Indexes +FollowSymLinks +ExecCGI

More info here: http://httpd.apache.org/docs/trunk/mod/core.html#options

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.