Directory directive error

#1
Trying to port my .htaccess rewrites directly into the server configuration. So on the rewrite tab of the virtual host config I went to the "Rewrite control" section and enabled rewrite. Then in the rewrite rules section I did this...

<Directory [pasted path of directory containing htaccess file here]>
[pasted rules from corresponding .htaccess file here]
</Directory>

and repeated for each .htaccess file I had. But I get a server error saying "Invalid rewrite directive <Directory ... "
 
#3
So that's why it doesn't work. But any tips to make it work? I imagine porting .htaccess files into the server config is fairly common. Esp. for people on openlitespeed, which doesn't support .htaccess files. Is there some other way of accomplishing the same thing?
 

NiteWave

Administrator
#4
please give a simple example rules in .htaccess, I'll show the "per server" rules. this will make the discuss easier.
I believe general instruction is well documented in apache's site.
 
#5
Example .htaccess in /regular:

Options +FollowSymlinks

IndexIgnore *

RewriteCond %{REQUEST_URI} !^/other/all\.php
RewriteCond %{REQUEST_URI} !^/other/each\.php

RewriteRule ^(.*)$ standards\.php?original=$1 [QSA,R,L]

Example .htaccess in /general:

<Files "general.php">
Order Allow,Deny
Deny from all
</Files>
 

Michael

Well-Known Member
Staff member
#6
Howdy,

You can find a number of discussions about this on openlitespeed.com. We try to keep OpenLiteSpeed discussion there or on the OpenLiteSpeed Google Group. This is not a common request for LSWS Standard or Enterprise (since people who have Apache configs just use the Apache configs with these editions) and is not that easy to do. The way to do it is to set up a context under your virtual host. The contexts work similarly to the <Directory> tag. Then you use paste your rewrite rules into there.

Cheers,

Michael
 
Top