用的是thinkphp
原地址:http://www.***.com/items/index?type=a
目标地址:http://www.***.com/a

解决方案 »

  1.   

    .htacess 我的也是伪静态ydtuiguang.com
    规则先写好,代码替换URL为规则里的格式
    RewriteEngine On
    #RewriteBase /
    # direct one-word access
    RewriteRule ^index\.html$ index\.php [L]
    RewriteRule ^tg([0-9]+)p([0-9]+)\.html$ column\.php?cid=$1&page=$2 [QSA,L]
    代码就要写
    $html = str_replace('index.php', 'index.html', $html);
    $html = preg_replace("/\"column.php\?cid=(\d+)&id=(\d+)&page=(\d+)/i", "\"tg$1id$2p$3.html", $html);
      

  2.   


     RewriteCond %{QUERY_STRING} ^(.*)$
     RewriteRule /([^\/]*) /items/index?type=$1&%1 [L,NC]
        
      

  3.   

    借花献佛,我也问怎么才能输入abc.com转到www.abc.com域名管理里没有A记录设置