Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RewriteEngine works in .htaccess but not virtualhost??

Status
Not open for further replies.

wootwoot

Programmer
Sep 22, 2005
1
US
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 :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top