[英]WordPress rewrite old URL to new one
I have WordPress installed and I have some old URls indexed, for example: 我安装了WordPress,并为一些旧的URls建立了索引,例如:
http://www.example.com/article-title.html
They were working before, but now I changed my URl structure so if I type in Web browser: 他们以前工作过,但是现在我更改了URl结构,因此,如果我输入Web浏览器:
http://www.example.com/article-title/
The new one is working but if I visit my old URL with .html, it gives me error 404. 新的可以使用,但是如果我使用.html访问旧的URL,则会出现错误404。
Is there a way for rewrite those old to new one? 有没有办法将那些旧的重写为新的?
Maybe 301 SEO redirect? 也许301 SEO重定向?
Thanks! 谢谢!
进入服务器上的.htaccess文件,然后在文件顶部添加类似以下内容
Redirect 301 /article-title.html http://www.example.com/article-title/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.