mod_rewrite and double slash issue

前端 未结 5 1000
半阙折子戏
半阙折子戏 2020-12-28 17:56

I applied the following mod_rewrite rule in Apache2 to redirect from non www to www:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^exa         


        
5条回答
  •  梦毁少年i
    2020-12-28 18:12

    Putting a slash into your pattern should resolve this issue:

    RewriteRule ^/(.*)$ http://www.example.com/$1 [R=301,L]
    

提交回复
热议问题