Forum Moderators: phranque
In the 1.X version of Apache these rules worked fine. I am trying to execute a rule as follows:
RewriteCond %{HTTP_HOST}!^www\.domain\.com [NC]
RewriteRule (.*) [domain.com...] [R=301,L]
In httpd.conf I have added the following:
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
The strange thing that is happening is that when I go to domain.com it IS forwarded to www.domain.com. However, when I go to domain.com/fox/ it DOES NOT forward to www.domain.com/fox/
Before, I only had to add the file to the root directory (public_html) and it worked for all sub-directories. However, not now. Am I missing something?
Thanks!
This option is likely set on your old server, but has not been set on your new server.
Jim
I put RewriteOptions inherit in the Virtual Host section for this site and it did nothing. What do you think? In 1.3X was it automatic that sub-directories inherited their parents .htaccess rules? This is how it worked on my server and I don't see anything in httpd.conf or individual htaccess files that addresses the RewriteOptions rule.
Maybe I am missing a .conf file somewhere? Hmmm..
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
This actually has no affect. So I leave this in somewhere towards the top or middle of httpd.conf and then I leave the other directive (RewriteOptions inherit) in the virtual host part for this site. And still, sub-directories do not re-direct. Very strange. Is there something that needs to be added to the sub-directory htaccess?
When I add the following to httpd.conf:
<Directory /home/*/public_html>
Options FollowSymLinks
AllowOverride FileInfo
</Directory>
I get a 500 error from the server.
I am not an idiot I promise. However, this is very strange to me.
.htaccess) in your directory (
/home/domain/public_html) and you have not allowed
Optionsto be overridden [httpd.apache.org].