try adding this to your .htaccess in wordpress root
Options +FollowSymLinks
<Directory /www/replace/this/with/actual/directory>
AllowOverride Options
</Directory>
@samboll —
This gets me closer — I can load the permalink version of the pages, the home page, and the page in the Apache DocumentRoot — thanks! But now it appears that Apache is not finding actual files and directories, so images, css, and wp-admin don’t work.
I’ll read the Apache manual to figure out what’s going on, but if you have any further advice or thoughts, I would be most grateful.
I’ll re-post if I find a solution.
My /home/user/blog/.htaccess
now looks like
Options +FollowSymLinks
<Directory /home/user/blog>
AllowOverride Options
</Directory>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
Thanks!!!
Ok, so I sorted out my remaining problem with permalinks and subdirectories. Adding the AllowOverride Options
in a <Directory /home/user/blog>
section was the trick.
The reason I continued to have problems was that the virtual host configuration was in conflict. It has a <Directory /home/user>
section that specified AllowOverride none
— this directive prevents the .htaccess file in the blog
subdirectory from ever getting evaluated.
Since I have access to the virtual host config, I was able to specify everything in one place, and eliminated the .htaccess file (as recommended by Apache documentation, for performance reasons). Here is the VirtualHost snippet, which accomplishes the same thing as the .htaccess file:
<VirtualHost *:80>
DocumentRoot /home/user/
ServerName mydomain.com
ServerAlias www.mydomain.com
<Directory "/home/user">
Options FollowSymLinks
AllowOverride none
Order allow,deny
Allow from all
</Directory>
<Directory "/home/user/blog">
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Note that the RewriteRule specifies . index.php
, not . /blog/index.php
since it is in the context of the <Directory /home/user/blog>
already.
(There are other things in the virtual host, but these are the relevant ones to my situation. And no, my user is not really user
🙂
Thanks again, samboll — I owe my eternal gratitude for your help!
I AM LOST! I have this problem as well, someone help!
I do not HAVE a htaccess file at all.
I need some clear instructions what goes where please?