Creating an exception when pointing a domain using A record (Shopify)

假装没事ソ 提交于 2019-12-25 12:11:16

问题


I am setting up a Shopify site using a custom domain. However, I have old links on that domain that I don't want to break once I point it to Shopify. I also have old parked domains on top of this domain that I don't want to break.

Shopify instructs you to set up an A record for the domain (so when I go to www.mydomain.com I see my Shopify store). But I want to set up exceptions such that www.mydomain.com/my-seo-link won't show Shopify, or will allow me to forward to its replacement at Shopify.

An added complication is I also have parked domains on top of my domain that I want to remain pointing to my old server.

Is there such thing as a URI exception to an A record?


回答1:


Put this code in your DOCUMENT_ROOT/.htaccess file of www.mydomain.com:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$ [NC]
RewriteRule ^my-seo-link http://otherdomain.com%{REQUEST_URI} [NC,R=301,L]



回答2:


Go through your list of special URL's and use the Shopify built-in redirect mechanism to point all your old content at the new location for it on your Shopify store's domain. The DNS system is old, well understood and you need to use it in this case as you cannot have a Shopify store on a domain AND host that same domain on another server under your control. Use redirects. That is what they are they for.



来源:https://stackoverflow.com/questions/24540168/creating-an-exception-when-pointing-a-domain-using-a-record-shopify

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!