0

Is is possible to configure WordPress permalinks directly in Apache httpd.conf?

I have a server situation (Apache 2.2.3 CentOS PHP5.1.6) where I can't use .htaccess for performance reasons, but can use httpd.conf.

The admin says that mod_rewrite is enabled, but AllowOverride is not, and I can't change those settings.

And I need to restrict the permalinks to just the "blog" directory.

This is what would go in .htaccess but needs to go into httpd.conf:

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

Thanks...

markratledge
  • 519
  • 5
  • 13
  • 26

1 Answers1

4

Put this within the container for your site.

<Directory /path/to/blog/>
  <IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /blog/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /blog/index.php [L]
  </IfModule>
</Directory>
user6738237482
  • 1,510
  • 12
  • 7