开发者

Classic ASP to Wordpress migration

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开发者_StackOverflow.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.


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 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜