简体   繁体   English

子域重定向和URL不跟踪

[英]Subdomain redirection and URL not chaging

I'm using godaddy to redirect with masking from http://myshop-123.com (a shopify webstore) to http://eu.myshop.com . 我正在使用Godaddy通过屏蔽将其从http://myshop-123.com (shopify网络商店)重定向到http://eu.myshop.com

I want the URL bar to change when the user navigates in the page. 我希望用户在页面中导航时URL栏发生变化。 For example, when user navigates to the page product_1.html, I want the browser's URL bar to show http://eu.myshop.com/product_1.html , which currently is not happening since the URL bar shows only http://eu.myshop.com/ no matter what. 例如,当用户导航到页面product_1.html时,我希望浏览器的URL栏显示http://eu.myshop.com/product_1.html ,由于URL栏仅显示http://而当前未发生eu.myshop.com/无论如何。

As far I've seen in the source of the http://eu.myshop.com when loaded, the page is being loaded in a frame: 据我在加载http://eu.myshop.com的源代码中所看到的,页面是在一个框架中加载的:

<html>
 <head>...</head>
 <frameset rows="100%,*" border="0">
 <frame src="http://myshop-123.com" frameborder="0">
  #document
 </frame>
 <frame ..>
 </frame>
</html>

How can I make the subdomain show the changes in the URL bar when the user navigates the page? 当用户浏览页面时,如何使子域显示URL栏中的更改?

I have even tried to manipulate the browser history with the HTML5 pushState , but still no results and I guess because of the godaddy's redirection and frame. 我什至尝试使用HTML5 pushState操纵浏览器历史记录,但仍然没有任何结果,我猜是因为Godaddy的重定向和框架。

(note: the links are fictitious). (注意:链接是虚构的)。

You can do it with .htaccess file : 您可以使用.htaccess文件执行此操作:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^myshop-123.com$
RewriteRule ^(.*)$ http://eu.myshop.com/$1 [QSA,L]

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM