URI is empty --> redirect to /nl (default language)
URI is /en OR /nl --> redirect to /en/ OR /nl/ (add forward slash)
URI is /oldurl1 --> redirect to /newurl1
URI is /oldurl2 --> redirect to /newurl2
...
URI is /oldurlX --> redirect to /newurlX
URI is NOT ANY of the known old URLs or new ones --> show nl/404
没有最后一行,默认的Wordpress 404不会显示,而是显示浏览器404。
RewriteEngine On
RewriteBase /
# URI is empty --> redirect to /nl (default language)
RewriteRule ^$ nl/ [R=301,L]
# URI is /en OR /nl --> redirect to /en/ OR /nl/ (add forward slash)
RewriteRule ^(en|nl)$ $1/ [R=301,L]
# URI is /oldurl1 --> redirect to /newurl1
RewriteRule ^(oldurl1|oldurl1/)$ nl/newurl1/ [R=301,L]
# URI is NOT ANY of the known old URLs or new ones --> show nl/404
RewriteRule !^(nl|en|nl/|en/|oldurl1|oldurlX......this can't be right)$ nl/404
将所有未知网址定向到404网页的有效方法是什么?
答案 0 :(得分:0)
每个WordPress主题都可以使用自己的404错误页面。还有一些插件可以自定义默认的Wordpress 404页面