gpt4 book ai didi

apache - URL 新闻 ID 的重写规则

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:31:44 29 4
gpt4 key购买 nike

我有点坚持 RewriteRule 301,从旧新闻 ID 更改为新新闻 ID

这是我尝试过的:

RewriteRule ^/news/0(.*)$ /news/$1 [L,R=301]

假设新闻 URL 看起来像他的:

http://www.mydomain.com/news/01/title-of-the-new
http://www.mydomain.com/news/09/title-of-the-new
http://www.mydomain.com/news/012/title-of-the-new
http://www.mydomain.com/news/032/title-of-the-new

我想更改为:

http://www.mydomain.com/news/1/title-of-the-new
http://www.mydomain.com/news/9/title-of-the-new
http://www.mydomain.com/news/12/title-of-the-new
http://www.mydomain.com/news/32/title-of-the-new

最佳答案

我设法修复它替换

RewriteRule ^/news/0(.*)$ /news/$1 [L,R=301] 

RewriteRule ^news/0(.*)$ /news/$1 [L,R=301]

关于apache - URL 新闻 ID 的重写规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6635547/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com