我正在尝试使用以下.htaccess
配置重写我的域以转到我的子域:
RewriteEngine on
RewriteCond %{http_host} ^example.com [nc]
RewriteRule ^(.*)$ http://sub.example.com/$1 [R=301,NC ]
我错过了什么?
答案 0 :(得分:0)
NC标志后不允许有空格,用以下代码替换代码:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^ http://sub.example.com%{REQUEST_URI} [R=301,NC,L]