Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/257.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过PHP删除指向站点所有页面的部分链接_Php - Fatal编程技术网

通过PHP删除指向站点所有页面的部分链接

通过PHP删除指向站点所有页面的部分链接,php,Php,我看到这个代码,为所有页面添加www if ( strpos($_SERVER['HTTP_HOST'], 'www.') === 0 ) { header('HTTP/1.1 301 Moved Permanently'); header('Location: http://' . substr($_SERVER['HTTP_HOST'], 4) . $_SERVER['REQUEST_URI']); exit(); } elseif ( strpos($_SERVER['HTTP_HOST'

我看到这个代码,为所有页面添加www

if ( strpos($_SERVER['HTTP_HOST'], 'www.') === 0 ) {
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://' . substr($_SERVER['HTTP_HOST'], 4) . $_SERVER['REQUEST_URI']);
exit();
} elseif ( strpos($_SERVER['HTTP_HOST'], 'www.') !== 0 ) {
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
exit();
}

我想编辑它以删除网站所有页面链接的一部分,我的网站中的链接如
。/index.php?styleid=1
我想删除
?styleid=x
&styleid=x
如果我的链接上存在使用
脚本名称
而不是
请求URI
,然后。你可以在
中管理它-file@MarcB ,我不能理解你,你能给我吗exmpel@pbaldauf,我知道,但我想自己做php@omardealo好的,由你决定