cpl*_*lus 6 regex .htaccess redirect blogger url-masking
在Rounin的回答中 仔细撰写(非常感谢)关于如何将任何具有任何扩展名的blogspot网址重定向到mydomain.com对应的URL,现在问题是如何掩盖URL?我的意思是,一旦blogspot URL重定向到mydomain.com,我想继续显示原始的blogspot URL而不是mydomain.com.
您可以使用以下 JavaScript 代码片段来实现 -
<script>
site = "http://example.com"; // The site which you want to mask, don't add ending slash
iFrame = document.createElement("iframe"); // Creates a iframe via JavaScript
iFrame.setAttribute("src", site + location.pathname); // Set the source of iFrame
iFrame.setAttribute("class", "maskingFrame"); // Add class to iFrame
document.body.appendChild(iFrame); // Append iframe to body of page
</script>
Run Code Online (Sandbox Code Playgroud)
最基本的 CSS 是 -
body {
overflow:hidden;
}
.maskingFrame, body {
width:100%;
height:100%;
border: none;
}
Run Code Online (Sandbox Code Playgroud)
您可以在此处(这是主页)和此处查看演示(这是来自其他网站的内部 URL,原始 blogspot URL 中不存在)