我最近搬到了另一台服务器,但是一个iframe暂时需要服务器来自旧服务器。我需要重定向
到
http://123.456.789.012/iframe/ *
在我尝试的example.com/iframe/.htacces中
RewriteCond %{REQUEST_URI} /iframe/(.*)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://123.456.789.012/$1 [L,R=302]
和
RewriteRule iframe/(.*)$ http://123.456.789.012/iframe/$1 [R=301,NC,L]
(等等)都失败了。
编辑:
我错过了什么? 感谢
答案 0 :(得分:1)
在example.com/iframe/.htacces
:
RewriteEngine On
RewriteCond %{HTTP_HOST} !=123.456.789.012
RewriteRule ^(.*)$ http://123.456.789.012/iframe/$1 [L,R=302,NE]
在完全清除浏览器缓存后对其进行测试。