子域重定向和URL未更改

Subdomain redirection and URL not chaging

本文关键字:URL 重定向      更新时间:2023-09-26

我正在使用godaddy从http://myshop-123.com(shopify网店)http://eu.myshop.com.

我希望用户在页面中导航时更改URL栏。例如,当用户导航到页面product_1.html时,我希望浏览器的URL栏显示http://eu.myshop.com/product_1.html,由于URL栏仅显示http://eu.myshop.com/不管怎样。

据我所见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>

当用户浏览页面时,如何使子域在URL栏中显示更改?

我甚至尝试过用HTML5 pushState操作浏览器历史,但仍然没有结果,我想是因为godaddy的重定向和框架。

(注意:链接是虚构的)

您可以使用.htaccess文件:

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