我在 FTP 根目录上有两个文件夹。site_v1
和site_v2
。site_v2 有新版本的网站,site_v1 有旧版本。我想将我的域指向site_v2
最新版本。所以我在根目录下做了一个.htaccess。
RewriteCond %{HTTP_HOST} example.com
RewriteCond %{REQUEST_URI} !site_v2/
RewriteRule ^(.*)$ site_v2/$1 [L]
这很好用。当我打开http://example.com时;site_v2 无缝加载。
然后,对于 site_v1,我创建了一个子域http://old.example.com并将其指向 site_v1 文件夹;运行http://old.example.com时出现此错误。
The requested URL /site_v1/site_v2/site_v1/index.html
was not found on this server.
我一无所知。由于根目录下的 .htaccess ,似乎http://old.example.com仍指向 site_v2。什么可能是解决方案,所以我可以强制 old.example.com 加载site_v1
?