htaccess重定向一些个人网址301 SEO

时间:2018-01-25 16:07:53

标签: .htaccess redirect seo

我们的BLOG网址上的内容已更改。 不,我想在网址中删除一些网址路径。

示例:

旧网址: https://do-main.de/blog/输入 /模具-XXX-DER-肖像

新网址: 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]

结论所有带“条目”的URL应仅使用/ blog / without / entry / 你明白吗?有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

您可以使用Redirect指令。

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

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