Hi, I am trying to optimize my apache server so I am getting rid of .htaccess files. I am running Apache2 on FreeBSD
So in the httpd.conf file I set:
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
["AllowOverride None" prevents apache from looking for .htaccess files]
I then take the function .htaccess file and essentially put it into the VirtualHost entry for the target domain:
<VirtualHost *>
DocumentRoot / ServerName meyers.com
ServerAlias ErrorDocument 404 /404.rub
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/secret(.*)$ [L,R]
</VirtualHost>
Now the above code does NOT work. It works fine when it in an .htaccess file but it does not work when I move it into the httpd.conf file, set AlloweOverride to "None", and restart apache.
I am truly lost as to what oculd be the problem. Any ideas? Thanks in advance![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
So in the httpd.conf file I set:
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
["AllowOverride None" prevents apache from looking for .htaccess files]
I then take the function .htaccess file and essentially put it into the VirtualHost entry for the target domain:
<VirtualHost *>
DocumentRoot / ServerName meyers.com
ServerAlias ErrorDocument 404 /404.rub
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/secret(.*)$ [L,R]
</VirtualHost>
Now the above code does NOT work. It works fine when it in an .htaccess file but it does not work when I move it into the httpd.conf file, set AlloweOverride to "None", and restart apache.
I am truly lost as to what oculd be the problem. Any ideas? Thanks in advance