duanlingzei0170 2011-03-11 12:45
浏览 26
已采纳

经典的ASP到Wordpress迁移

I have a Wordpress install on a domain, and I am setting up my rewrite rules now. The old site runs on asp and the new site php.

These are my rules, which I am inserting manually into 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

The middle one works, the other 2 don't. turkey-property-news and turkey-real-estate are actual directories with an index.php running a custom query, whereas the last rule uses the core wordpress functionality.

As mod_rewrite is not my mastermind chosen subject I was hoping to get some help here.

  • 写回答

1条回答 默认 最新

  • dtrhd2850 2011-03-11 13:06
    关注

    Query strings (the bit after the ?) are not part of a URL; you can filter on them using a rewriteCond statement. Something like this:

    rewriteCond %{QUERY_STRING} ^id=([^/0-9]+)$ 
    rewriterule ^news_details.asp$ turkey-property-news/index.php?old_id=%1 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算