Order allow...">

Apache: how to use rename engine inside alias

I have this alias configuration:

Alias /test/ "D:/WWW/Test/" <Directory "D:/WWW/Test/"> Order allow,deny Allow from all </Directory> 

Then, inside the D:/WWW/Test/ directory, I will put .htaccess with the following configuration:

 <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^([^.]*\.css)$ resources/$1 [L,NC] </IfModule> 

I just want to redirect all requests from localhost/test/css/* to localhost/test/resources/css/* .

But it seems that .htaccess ignored. Even if I put DirectoryIndex blablabla.php , the browser still displays index.html.

How to solve this? Thanks.

+4
source share
1 answer

You need three things:

  • Inside <Directory> allow .htaccess files with AllowOverride All .
  • Grant the required mod_rewrite permissions with Options FollowSymLinks .
  • Inside .htaccess, enable RewriteBase /test/ .
+10
source

Source: https://habr.com/ru/post/1396057/


All Articles