2011-03-11 51 views
1

我有一个域上的Wordpress安装,现在我正在设置我的重写规则。旧网站在asp和新网站php上运行。经典的ASP到Wordpress的迁移

这是我的规则,我手动插入的htaccess

RewriteRule ^news_details.asp?id=([^/0-9]+)$ turkey-property-news/index.php?old_id=$1 
RewriteRule ^property_([0-9]+).asp$ turkey-real-estate/index.php?old_id=$1 
RewriteRule ^links1.asp?id=([0-9]+)$ index.php?post_type=sbdirectory&old_id=$1 

中间的一个工作,其他2则没有。 turkey-property-news和turkey-real-estate是实际的目录,其中index.php运行自定义查询,而最后一条规则使用核心wordpress功能。

由于mod_rewrite不是我的主谋选择的主题,我希望在这里得到一些帮助。

+0

“不起作用”不是一个有用的错误描述。访问这些网址时会发生什么或不会发生什么? – 2011-03-11 12:47:42

+0

基本上url重写不受影响,服务器处理原始的news_details.asp?id = etc – 2011-03-11 12:56:17

回答

1

查询字符串(?之后的位)不是URL的一部分;你可以使用rewriteCond语句对它们进行过滤。类似这样的:

rewriteCond %{QUERY_STRING} ^id=([^/0-9]+)$ 
rewriterule ^news_details.asp$ turkey-property-news/index.php?old_id=%1