阿帕奇:如何使用重写引擎内部别名重写、别名、如何使用、阿帕奇

由网友(刚下凡不久)分享简介:我有这个别名的配置:Alias /test/ "D:/WWW/Test/"Order allow,denyAllow from all然后在 D:/ WWW /测试/ 目录,我把htaccess的,配置如下:Then inside D:...

我有这个别名的配置:

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

然后在 D:/ WWW /测试/ 目录,我把htaccess的,配置如下:

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

<IfModule mod_rewrite.c>
  RewriteEngine on

  RewriteRule ^([^.]*.css)$ resources/$1 [L,NC]
</IfModule>

我只是想重定向从本地主机/测试/ CSS / * 本地主机/测试/资源/ CSS / * 。

但似乎的.htaccess 被忽略。即使我把的DirectoryIndex blablabla.php ,浏览器仍然显示的index.html。

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

如何解决此问题?谢谢你。

How to solve this? Thank you.

推荐答案

您需要三样东西:

&LT;目录&GT; ,允许使用.htaccess文件的AllowOverride全部 提供的mod_rewrite的权限与有FollowSymLinks 。 在的.htaccess,包括的RewriteBase /测试/ 。 Inside <Directory>, allow .htaccess files with AllowOverride All. Give the required permissions of mod_rewrite with Options FollowSymLinks. Inside the .htaccess, include RewriteBase /test/.