我已经找到了许多301 htaccess重定向的例子,但是我需要一些特定的东西,并且不知道如何构建精确的重定向规则.我所建的网站是一个wordpress网站。
示例:
http://www.example.com/article/some-article-01.html
http://www.example.com/article/data-analysis.html
http://www.example.com/article/another-page.html重定向到:
http://www.example.com/article/some-article-01/
http://www.example.com/article/data-analysis/
http://www.example.com/article/another-page/寻找一条适用于wordpress的htaccess规则..。
一个指向相关数据的指针将很快被接受。似乎找不到正确的搜索查询。当然,示例代码要容易得多。
发布于 2014-07-21 13:45:19
将此规则插入您的DOCUMENT_ROOT/.htaccess文件中,作为第一条规则,就在RewriteBase行下面:
RewriteEngine On
RewriteBase /
RewriteRule ^(article/[^.]+)\.html$ /$1/ [L,NC,R=302]如果它对您有效,那么将302更改为301,使其永久重定向。
https://stackoverflow.com/questions/24864281
复制相似问题