简体   繁体   English

Apache重写规则问题

[英]Apache rewrite rules issue

Below are the contents of my apache conf files. 以下是我的apache conf文件的内容。 I am expecting the following behavior:- 我期望以下行为:-

Could someone give feedback on what i am doing wrong. 有人可以就我做错的事情提供反馈。 As far as i understand RewriteRule is context aware and these should work as expected. 据我了解,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> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM