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
Apache 强制www不适用于子文件夹_Apache_.htaccess_Server - Fatal编程技术网

Apache 强制www不适用于子文件夹

Apache 强制www不适用于子文件夹,apache,.htaccess,server,Apache,.htaccess,Server,这不适用于子文件夹 RewriteEngine on Options +FollowSymLinks RewriteCond %{HTTP_HOST} ^mysite.com/wordpress/ [NC] RewriteRule ^(.*)$ http://www.exemple.com/wordpress/$1 [L,R=301] 但这是可行的 RewriteEngine on Options +FollowSymLinks RewriteCond %{HTTP_HOST} ^m

这不适用于子文件夹

RewriteEngine on 
Options +FollowSymLinks 
RewriteCond %{HTTP_HOST} ^mysite.com/wordpress/ [NC] 
RewriteRule ^(.*)$ http://www.exemple.com/wordpress/$1 [L,R=301]
但这是可行的

RewriteEngine on 
Options +FollowSymLinks 
RewriteCond %{HTTP_HOST} ^mysite.com/ [NC] 
RewriteRule ^(.*)$ http://www.exemple.com/$1 [L,R=301]
谢谢。

您可以使用:

RewriteEngine on 
Options +FollowSymLinks 
RewriteCond %{HTTP_HOST} ^exemple\.com$ [NC] 
RewriteRule ^wordpress/(.*)$ http://www.exemple.com/wordpress/$1 [NC,L,R=301]