Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.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
Apache 通过添加php参数重定向_Apache_.htaccess_Redirect - Fatal编程技术网

Apache 通过添加php参数重定向

Apache 通过添加php参数重定向,apache,.htaccess,redirect,Apache,.htaccess,Redirect,我需要从设置永久重定向 /models_com/dpanorama/ 到 如何使用.htaccess文件实现这一点?请原谅我没有准确回答您的问题。我不知道该如何使用.htaccess。但是你能不能在你的php脚本上强制执行呢?比如: if (!isset($_GET["t"])){ $t = "cm"; } 试试这个: RewriteEngine on RewriteCond %{QUERY_STRING} !t=cm RewriteRule ^models_com/dpanorama/

我需要从设置永久重定向

/models_com/dpanorama/


如何使用.htaccess文件实现这一点?

请原谅我没有准确回答您的问题。我不知道该如何使用.htaccess。但是你能不能在你的php脚本上强制执行呢?比如:

if (!isset($_GET["t"])){
  $t = "cm";
}
试试这个:

RewriteEngine on
RewriteCond %{QUERY_STRING} !t=cm
RewriteRule ^models_com/dpanorama/$ /models_com/dpanorama/?t=cm [L,R=301]
RewriteEngine on
RewriteCond %{QUERY_STRING} !t=cm
RewriteRule ^models_com/dpanorama/$ /models_com/dpanorama/?t=cm [L,R=301]