admin管理员组文章数量:1130349
I am migrating a website from vivvo cms to wordpress. Vivvo is using category pages like index.numberofthepage.html
I want to redirect urls like using regex:
.200.html
to
/
mycats could be more than one category ex cat1/cat2... and the 200 could be any number. I used :
^/index.(.*?)\.html to ^/page/$1/
But not redirecting. Thanks
I am migrating a website from vivvo cms to wordpress. Vivvo is using category pages like index.numberofthepage.html
I want to redirect urls like using regex:
https://www.example/mycats/index.200.html
to
https://www.example/mycats/page/200/
mycats could be more than one category ex cat1/cat2... and the 200 could be any number. I used :
^/index.(.*?)\.html to ^/page/$1/
But not redirecting. Thanks
Share Improve this question edited Jan 6, 2019 at 18:54 yazuk asked Jan 6, 2019 at 14:58 yazukyazuk 851 silver badge5 bronze badges 4- Please add the context in which you are using the redirect rule. – fuxia ♦ Commented Jan 6, 2019 at 18:41
- I migrated a website from vivvo cms to wordpress. Iwould like to avoid 404 errors. Vivvo is using category pages like index.**numberpage**.html – yazuk Commented Jan 6, 2019 at 18:51
- I mean: are you using the regex in a PHP file, in an nginx config or in a .htaccess? Right now it's impossible even to guess what is wrong. – fuxia ♦ Commented Jan 6, 2019 at 19:18
- using the regex in the plugin "Redirection" link – yazuk Commented Jan 6, 2019 at 22:53
1 Answer
Reset to default 1Since category and page number is dynamic, you can use htaccess and use this sample rewrite rule below:
RewriteRule (.*?)/index.(.*?)\.html $1/page/$2/
You can test the regex here - https://htaccess.madewithlove.be/ and I can see that it is working as far as I have tested it.
PS: URL Redirections are cached aggresively, you need to clear you browser cache completely to make sure that you are testing it properly.
Hope this helps!
I am migrating a website from vivvo cms to wordpress. Vivvo is using category pages like index.numberofthepage.html
I want to redirect urls like using regex:
.200.html
to
/
mycats could be more than one category ex cat1/cat2... and the 200 could be any number. I used :
^/index.(.*?)\.html to ^/page/$1/
But not redirecting. Thanks
I am migrating a website from vivvo cms to wordpress. Vivvo is using category pages like index.numberofthepage.html
I want to redirect urls like using regex:
https://www.example/mycats/index.200.html
to
https://www.example/mycats/page/200/
mycats could be more than one category ex cat1/cat2... and the 200 could be any number. I used :
^/index.(.*?)\.html to ^/page/$1/
But not redirecting. Thanks
Share Improve this question edited Jan 6, 2019 at 18:54 yazuk asked Jan 6, 2019 at 14:58 yazukyazuk 851 silver badge5 bronze badges 4- Please add the context in which you are using the redirect rule. – fuxia ♦ Commented Jan 6, 2019 at 18:41
- I migrated a website from vivvo cms to wordpress. Iwould like to avoid 404 errors. Vivvo is using category pages like index.**numberpage**.html – yazuk Commented Jan 6, 2019 at 18:51
- I mean: are you using the regex in a PHP file, in an nginx config or in a .htaccess? Right now it's impossible even to guess what is wrong. – fuxia ♦ Commented Jan 6, 2019 at 19:18
- using the regex in the plugin "Redirection" link – yazuk Commented Jan 6, 2019 at 22:53
1 Answer
Reset to default 1Since category and page number is dynamic, you can use htaccess and use this sample rewrite rule below:
RewriteRule (.*?)/index.(.*?)\.html $1/page/$2/
You can test the regex here - https://htaccess.madewithlove.be/ and I can see that it is working as far as I have tested it.
PS: URL Redirections are cached aggresively, you need to clear you browser cache completely to make sure that you are testing it properly.
Hope this helps!
本文标签: regexRedirect 301 of old urls to wordpress urls
版权声明:本文标题:regex - Redirect 301 of old urls to wordpress urls 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749037615a2306636.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论