开发者

simple .htaccess rule wont work in httpd.conf

Im trying to move a bunch of rewrite rules from a .htaccess file to a the apache config files, I get no errors and placed this within the VirtualHost section of the sites config file:

<Directory /var/www/da/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny

        allow from all

        RewriteEngine On
        RewriteBase /

  开发者_如何转开发      RewriteRule ^botswana/central-kalahari/$ /central-kalahari/ [R=301,L]

</Directory>


Rewrite Rules placed in server config / virtual host context will start with leading slash -- that is one of the differences from .htaccess behaviour. Therefore use this one:

RewriteRule ^/botswana/central-kalahari/$ /central-kalahari/ [R=301,L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜