Forums

Permalinks! - httpd instead of htaccess (1 post)

  1. endianx
    Member
    Posted 6 years ago #

    This post is to help those who are using permalinks and have their own apache install and are making changes to httpd.conf instead of an htaccess file.

    WordPress will assign code that looks something like the following:

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

    When you add this to httpd.conf, Apache2 will throw an error when you try to restart your server, due to the RewriteBase line. My first try with this, I removed the line, thinking maybe I didn't need it with an httpd.conf file. I was never able to get it working, however, and it is because that directive is essential. Instead, you must do the following:

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

    Note the Directory tag. That should work. Hope this helps someone.

    - endianx -

Topic Closed

This topic has been closed to new replies.

About this Topic