0

以下是我的 apache conf 文件的内容。我期待以下行为: -

有人可以就我做错了什么提供反馈。据我了解 RewriteRule 是上下文感知的,这些应该按预期工作。

<VirtualHost *:80>
    DocumentRoot "C:/wamp/www/mylocalhost"
    ServerName www.mywebsite

    # Other directives here
    RewriteEngine   on
    RewriteRule ^/google$   http://www.google.com/ [R]  
</VirtualHost>

Alias /somecode "C:/somecodedir/"

<Directory "C:/somecodedir/">
    RewriteEngine   on
    RewriteRule ^/google$   http://www.yahoo.com/ [R]

    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
        Allow from all
</Directory> 
4