• 0 down vote favorite

    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]
        </IfModule>
    
    </Directory>

    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.

    Any help would be greatly appreciated. Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter supmethods

    (@supmethods)

    Also I’ve checked the rewrite logs and noticed that the parameter RewriteBase passes through the request without doing anything:

    110.175.55.89 – – [28/Jun/2014:15:52:00 +1000] [dev.ebizimate.com/sid#7f6cbbab7738 [rid#7f6cbbd07c38/initial] (2) init rewrite engine with requested uri /blog/
    110.175.55.89 – – [28/Jun/2014:15:52:00 +1000] [dev.ebizimate.com/sid#7f6cbbab7738][rid#7f6cbbd07c38/initial] (1) pass through /blog/

    Thread Starter supmethods

    (@supmethods)

    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: https://httpd.apache.org/docs/trunk/mod/core.html#options

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Permalinks errar – page not found. Modifying the httpd.conf file directly’ is closed to new replies.