Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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
.htaccess mod_rewrite将子域重定向到url,并在url路径中保留子域_.htaccess_Mod Rewrite - Fatal编程技术网

.htaccess mod_rewrite将子域重定向到url,并在url路径中保留子域

.htaccess mod_rewrite将子域重定向到url,并在url路径中保留子域,.htaccess,mod-rewrite,.htaccess,Mod Rewrite,我在{rest of url}创建了一个简单的网页 我想要{url的其余部分} 在其他论坛上,ppl让我移动页面,不幸的是,这是不可能的,因为该页面正在使用页面其余部分的其他控制器和模型和/mobile/is not文件夹,它是codeigniter控制器的名称,也定义了购买其他htaccess规则 我创建了子域mobile dot domain.com,我想用以下形式保留URL重定向来自它的所有流量:mobile dot domain dot com/{path}尝试将此添加到您的htacce

我在{rest of url}创建了一个简单的网页

我想要{url的其余部分}

在其他论坛上,ppl让我移动页面,不幸的是,这是不可能的,因为该页面正在使用页面其余部分的其他控制器和模型和/mobile/is not文件夹,它是codeigniter控制器的名称,也定义了购买其他htaccess规则


我创建了子域mobile dot domain.com,我想用以下形式保留URL重定向来自它的所有流量:mobile dot domain dot com/{path}

尝试将此添加到您的htaccess:

RewriteCond %{HTTP_HOST} ^mobile.domain.com$ [NC]
RewriteRule ^(.*)$ /mobile/$1  [L]
如果htaccess文件中有其他重写规则,则可能需要将其添加到其他规则之前