Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/281.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.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 .htaccess将url重定向到url友好的子域_Php_Apache_.htaccess_Mod Rewrite_Redirect - Fatal编程技术网

Php .htaccess将url重定向到url友好的子域

Php .htaccess将url重定向到url友好的子域,php,apache,.htaccess,mod-rewrite,redirect,Php,Apache,.htaccess,Mod Rewrite,Redirect,我有一个域,我拼命地试图将它上的一个特定URL重定向到另一个作为子域的URL。 子域使用友好的URL方案 我在.htaccess文件中使用了以下内容,但对查询字符串部分无效 RewriteBase / RewriteCond %{HTTP_HOST} ^www.appninjaz.com RewriteRule ^server/data/(.*)$ http://universe.appninjaz.com/data/$1 [L,R=301] 所以基本上,我想做的是: 重定向此URL: 要访问

我有一个域,我拼命地试图将它上的一个特定URL重定向到另一个作为子域的URL。 子域使用友好的URL方案

我在.htaccess文件中使用了以下内容,但对查询字符串部分无效

RewriteBase /
RewriteCond %{HTTP_HOST} ^www.appninjaz.com
RewriteRule ^server/data/(.*)$ http://universe.appninjaz.com/data/$1 [L,R=301]
所以基本上,我想做的是: 重定向此URL: 要访问此子域URL,请执行以下操作:

应用程序id可以是任何数字/id 谢谢,, 亚尼夫

试试这个:

RewriteCond %{HTTP_HOST} ^www.appninjaz.com
RewriteCond %{QUERY_STRING} app_id=([0-9]+)
RewriteRule ^server/data/index\.php$ http://universe.appninjaz.com/data/%1? [L,R=301]