简体   繁体   English

在同一URL中重定向网站

[英]Redirect a website within the same URL

Our company has multiple websites.Lets assume website 1 is demo.com and website 2 is example.com . 我们公司有多个网站。假设网站1是demo.com ,网站2是example.com

I wanted to add a link to demo.com to redirect me to example.com , but by keeping the URL of demo.com . 我想添加一个指向demo.com的链接以将我重定向到example.com ,但是要保留demo.com的URL。 So for instance, i need to display contents of example.com to demo.com/linkedwebsite . 因此,例如,我需要将example.com的内容显示到demo.com/linkedwebsite So instead of redirecting the link demo.com/linkedwebsite to example.com , i need to display the contents of example.com on demo.com/linkedwebsite ? 因此,我不需要将demo.com/linkedwebsite链接重定向到example.com ,而是需要在demo.com/linkedwebsite上显示example.com的内容?

I dont want to copy and paste the code, i would rather want to redirect automatically. 我不想复制并粘贴代码,我想自动重定向。

How can this be done? 如何才能做到这一点? I just need a direction to get me started. 我只需要一个指示即可开始。 We use codeigniter framework for our website. 我们为网站使用codeigniter框架。

I dont want to use IFRAME as example.com exists within our network only, so a client will only see a blank frame as they wont be able to access that information. 我不想使用IFRAME,因为example.com仅存在于我们的网络中,因此客户端将只能看到空白帧,因为他们将无法访问该信息。 Also we cannot use cURL as an option because the example.com website works on Java applet. 同样,我们不能使用cURL作为选项,因为example.com网站可在Java applet上运行。 So that wouldnt solve this issue. 这样就不能解决这个问题。

You can acomplish this by following this steps: 您可以按照以下步骤完成此操作:

  1. In your demo.com website directory create a fil called "linkedwebsite.html". 在您的demo.com网站目录中,创建一个名为“ linkedwebsite.html”的文件。
  2. Add the following code inside the tag of that website (replace google.com with your example.com url): 在该网站的标签内添加以下代码(将google.com替换为example.com网址):

 <iframe style="border:none; margin:0;" src="https://google.com" width="100%" height="600" frameBorder="0">Browser not compatible.</iframe> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 加密 URL 重定向到外部网站 - Encrypting URL of redirect to an outside website 在 Spring MVC 中重定向期间传递模型属性并在 URL 中避免相同 - Passing model attribute during redirect in spring MVC and avoiding the same in URL IIS / C#网站与Tomcat / Java网站共享身份验证-相同的顶级URL - IIS/C# website share authentication with Tomcat/Java website - same top level URL 如何使用Java中的一个身份验证在同一会话中命中多个URL - How to hit the multiple url within same session and with one authentication in java 如何使用ListView在同一WebView活动中启动不同的URL - How to launch different URL within same WebView Activity using ListView 无法使用 LegacyCookieProcessor 从响应中删除 cookie 并重定向到相同的原始 URL - Can't Remove cookie from response using LegacyCookieProcessor and redirect to same originating URL 如何从ajax url获取值到操作类,并在与Java弹出窗口相同的页面上重定向 - how to get the value from ajax url to action class and redirect on the same page as popup in java 如何重定向和授权在 ajax 成功中返回 jsp 页面的相同 url - How to redirect and authorize the same url which return the jsp page in ajax success 从网站重定向进行jsoup解析 - jsoup parse from website redirect Facebook Canvas重定向URL - Facebook Canvas Redirect URL
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM