【发布时间】:2012-07-11 04:19:04
【问题描述】:
我使用这个重写:
RewriteRule post-(.*)\.html$ post.php?id=$1
但后来将文件名 post.php 更改为 photo.php 所以我将其更改为
RewriteRule photo-(.*)\.html$ photo.php?id=$1
这很好,但是当访问者来自搜索引擎并被定向到原始文件名 post.php?id=?所以需要添加(我认为)301重定向,我试过了:
RewriteRule photo-(.*)\.html$ post.php?id=$1
和:
RewriteRule photo-(.*)\.html$ post-(.*)\.html$[L,R=301]
但两者都不起作用,老实说还没有真正的线索,请帮忙。
【问题讨论】:
标签: .htaccess mod-rewrite http-status-code-301