我希望www.example.com的每一页都能重定向到www.example.org
我在example.com的根目录中使用下面的example.com
RewriteEngine on
RewriteRule ^(.*)$ https://www.example.org/$1 [R=301,L]如果我导航到www.example.com,就会重定向到www.example.org --太棒了
如果我浏览到www.example.com/example.php,我可以从example.com获得404
编辑: Cloudflare缓存文件、接受的答案以及问题中的方法来将文件重定向到适当的页面。如果使用Cloudflare,则在开发时通过打开开发模式关闭缓存
发布于 2019-02-02 19:28:19
检查这个1:1重写:
RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?example\.com [NC] RewriteRule (.*) http://www.example.org/$1 [R=301,L]
https://stackoverflow.com/questions/54495549
复制相似问题