Ibe*_*dia 1 apache .htaccess redirect
我正在重新设计我的网站,并在此过程中重组一些链接结构.
要执行永久重定向,我使用以下代码(.htaccess)
RedirectMatch permanent old-link($|\.html) http://thedomain.com/new-link.url
Run Code Online (Sandbox Code Playgroud)
我正在使用CMS并更改类别的链接会更改URL的路径,如下所示:
thedomain.com/old-category-link/old-article-url.html
Run Code Online (Sandbox Code Playgroud)
至
thedomain.com/new-category-link/old-article-url.html
Run Code Online (Sandbox Code Playgroud)
我应该如何编码(.htaccess)任何具有的URL的重定向
thedomain.com/old-category-link
Run Code Online (Sandbox Code Playgroud)
(即
thedomain.com/old-category-link/old-article.html
thedomain.com/old-category-link/old-article-2.html
thedomain.com/old-category-link/old-article-999.html
Run Code Online (Sandbox Code Playgroud)
)
至
thedomain.com/new-category-link/any-articles-old-url.html
Run Code Online (Sandbox Code Playgroud)
谢谢
不确定你要求重定向到什么,但它是这样的吗?
RedirectMatch permanent old-category-link(.*) http://thedomain.com/new-category-link$1
Run Code Online (Sandbox Code Playgroud)
如果有人要求,这将是如此:
| 归档时间: |
|
| 查看次数: |
2837 次 |
| 最近记录: |