我有一个域名mydomain.com
我还有一个网站托管在myotherdomain.com/wordpress/website/
我想要的是,当有人在浏览器中输入mydomain.com/my_post/时,它会向他们显示myotherdomain.com/wordpress/website/my_post/ 我想这是.htaccess的工作,但我对如何处理它一无所知。 提前感谢!
这里是的示例代码
RewriteRule ^my_post/index.php http://myotherdomain.com/wordpress/website/my_post// [R=301,L]
希望这对你有帮助。感谢
上的重写引擎
重写规则^(.*)$http://myotherdomain.com/wordpress/website/my_post/[QSA,L]
您可能需要使用类似的东西
将重定向http://example.com/file.html到http://example.com/folder1/file.html:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} example.com$ [NC]
RewriteCond %{HTTP_HOST} !folder1
RewriteRule ^(.*)$ http://example.com/folder1/$1 [R=301,L]
完整指南https://kb.mediatemple.net/questions/85/Using+.htaccess+重写+规则#gs
[更新]
如果我是正确的,请尝试一下。
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.example1.com [NC]
RewriteRule ^(.*)$ http://www.example2.com/folder1/$1 [R=301,NC,L]
尝试添加一个带有以下代码的index.html:
<div id="iFrame1" style="position:absolute; left:0px; top:0px; z-index:0">
<iframe name="iFrame1" width="{Differs}%" height="100%" src="http://myotherdomain.com/wordpress/website/my_post/" scrolling="yes" frameborder="0"></iframe>
</div>
以下是GasBuddies网站的示例:
<div id="iFrame1" style="position:absolute; left:0px; top:0px; z-index:0">
<iframe name="iFrame1" width="455%" height="100%" src="http://gasbuddy.com/" scrolling="yes" frameborder="0"></iframe>
</div>