Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.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的情况下将所有站点页面运行到子域_Php_Wordpress_.htaccess_Prestashop - Fatal编程技术网

Php htaccess如何在不更改url的情况下将所有站点页面运行到子域

Php htaccess如何在不更改url的情况下将所有站点页面运行到子域,php,wordpress,.htaccess,prestashop,Php,Wordpress,.htaccess,Prestashop,我想重定向一个站点,但不更改地址栏中的URL。 比如:URL是:m.example.com,但这里应该运行example.com。example.com的所有页面都应该在这里运行 e、 g。 m、 example.com/about->example.com/about, 但是地址栏中的URL必须是m.example.com是的,这可以通过一些简单的.htaccess规则实现: RewriteEngine On RewriteCond %{HTTP_HOST} !^m\. RewriteRule

我想重定向一个站点,但不更改地址栏中的URL。 比如:URL是:m.example.com,但这里应该运行example.com。example.com的所有页面都应该在这里运行

e、 g。 m、 example.com/about->example.com/about,
但是地址栏中的URL必须是m.example.com

是的,这可以通过一些简单的.htaccess规则实现:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^m\.
RewriteRule ^(.*)$ http://m.%{HTTP_HOST}/$1 [R=301,L]
你们也可以阅读关于这个主题的伟大文章