[removed] in .htaccess causes 500 server error (Redirect to non-URL)

后端 未结 4 581
孤独总比滥情好
孤独总比滥情好 2021-01-05 04:28

have such kind of error.

When adding Redirect 301 rule to .htaccess file like:

Redirect 301 \"/page1.html\" \"/dir1/\"
         


        
4条回答
  •  梦谈多话
    2021-01-05 04:46

    I had same issue, for me this didn't work as well:

    RewriteRule ^/page1.html$ /dir1/page.html [R=301,L]
    

    What worked for me is to remove the leading slash, and add soft tailing slash with ?, like this:

    RewriteRule ^(page1.html)/?$ dir1/page.html [R=301,L]
    

提交回复
热议问题