开发者

simple .htaccess rule wont work in httpd.conf

开发者 https://www.devze.com 2023-03-27 00:41 出处:网络
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:

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

精彩评论

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