原因不明的解析错误[关闭]
I am working on a 301 redirect for an old OsCommerce website. The problem is it is hosted on a IIS/Windows server so htaccess modrewrite is not an option.
At this point I have redirected as follows
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.site.org.au/store/default.asp" );
exit();
However because the old shop URls are dynamic I am trying to redirect based on the cPath=something to the corrisponding page on the new site. So far I have
if (isset ($_GET['cPath']))
{
$cPath = $_GET['cPath'];
if ($cPath == 22_33) { $goto = "http://www.store.org.au/store/shop_clothing/shop_clothing_summer_adults_ladies"; }
if ($cPath == 21) {$goto = "http://www.cancervic.org.au/store/shop_shade"; }
header("HTTP/1.1 301 Moved Permanently");
header("Location: " . $goto);
exit();
}
problem is with this I get an error:
Parse error: syntax error, unexpected T_STRING in E:\inetpub\esvc001202\index.php
I'd appreciate any tips on getting this to work.
Thanks
Cheers Laurence
我正在为旧的OsCommerce网站进行301重定向。 问题是它托管在IIS / Windows服务器上,因此htaccess modrewrite不是一个选项。 p>
此时我已重定向如下 p>
标题(“HTTP / 1.1 301永久移动”);
Header(“Location:http://www.site.org.au/store/default.asp”);
exit();
code> pre>
然而,因为旧商店URls是动态的,我试图将基于cPath =的东西重定向到新网站上的相应页面。 到目前为止,我有 p>
if(isset($ _GET ['cPath']))
{
$ cPath = $ _GET ['cPath'];
\ nif($ cPath == 22_33){$ goto =“http://www.store.org.au/store/shop_clothing/shop_clothing_summer_adults_ladies”; }
if($ cPath == 21){$ goto =“http://www.cancervic.org.au/store/shop_shade”; }
header(“HTTP / 1.1 301永久移动”);
header(“位置:”。$ goto);
exit();
}
code> pre>
问题在于我得到一个错误: p>
解析错误:语法错误,E:\ inetpub \ esvc001202 \ index.php中的意外T_STRING p>
我很感激任何关于让它发挥作用的提示。 p>
谢谢 p>
干杯
Laurence p>
div >
Quote this string:
if ($cPath == "22_33")