我们的博客网址有些变化。
不,我想在url中删除一些url路径。
例子:
旧网址:
https://do-main.de/blog/进入/死亡
新网址:
https://do-main.de/blog/die-xxx-der-portrait
我的htaccess尝试设置:

#OLD BLOG URLS
RewriteEngine On

# anything that is equal to https://do-main.de/blog/entry/*
RewriteCond %{HTTP_HOST} ^do\-main\.de\/blog\/entry\/$

# redirects to https://do-main.de/blog/*
RewriteRule ^/?(.*)$ https://do-main.de/blog/$1 [R=301,L]

结论所有带有entry的url应该只使用/blog/without/entry/
你明白吗?有人能帮忙吗?

最佳答案

您可以使用Redirect指令。

Redirect 301 /blog/entry/ http://example.com/blog/

这将301将所有请求从example.com/blog/entry/foobar重定向到http:// example.com/blog/foobar

10-07 19:16
查看更多