【发布时间】:2017-09-03 09:20:03
【问题描述】:
您好,我在 301 重定向时遇到 .htaccess 问题。
90% 的 url 上一切看起来都很好,但对于任何单独的博客文章重定向都没有。
这是他们不重定向的代码:
RewriteRule ^blog-article.php?id=38 blog-post/xxxx-xxxxxx-xx-x-xxxxxxx/9/ [L,NC,R=301]
RewriteRule ^blog-article.php?id=34 blog-post/xxxxxxx/4/ [L,NC,R=301]
但所有其他 301 重写工作,它们看起来像这样:
RewriteRule ^old-url-portfolio/(.*)$ page/new-url-portfolio/$1 [L,NC,R=301]
RewriteRule ^Portfolio/Detail/(.*)$ portfolio/$1 [L,NC,R=301]
RewriteRule ^old-url/7/ page/new-url/ [L,NC,R=301]
RewriteRule ^contact-us-old/ page/contact-us-new/ [L,NC,R=301]
RewriteRule ^blog.php page/blog/ [L,NC,R=301]
我找不到他们为什么不工作,不是因为那些不工作的是个别文件,因为 blog.php 文件正在被发送到新页面。
任何想法将不胜感激:)
【问题讨论】:
标签: apache .htaccess redirect mod-rewrite