简体   繁体   English

使用.htaccess屏蔽子域名重定向到shopify.com

[英]Using .htaccess to mask a sub-domain redirect to shopify.com

I am currently using bluehost a registrar for my domain www.exampledomain.com . 我目前正在为我的域名www.exampledomain.com使用bluehost一个注册商。 I created a sub-domain redirect using bluehost C-panel to make a sub domain shop.exampledomain.com that redirects to exampledomain.myshopify.com 我使用bluehost C面板创建了一个子域重定向,以使子域shop.exampledomain.com重定向到exampledomain.myshopify.com。

I want the url of the sub-domain to mask the url of the shopify domain. 我希望子域的URL掩盖shopify域的URL。 So if you click on shop from the root, it would redirect to the sub-domain shop.exampledomain.com and re-write this for every url masking the exampledomain.myshopify.com 因此,如果您从根目录单击shop,它将重定向到子域shop.exampledomain.com,并为每个屏蔽exampledomain.myshopify.com的网址重新编写该代码

I have used godaddy before and they offer a feature that does this, but I can't transfer do to an e-mail setup. 我以前使用过Godaddy,他们提供了可以执行此操作的功能,但是我无法将其转移到电子邮件设置中。 Bluehost says they do not offer this feature, but they do offer .htaccess apache and php. Bluehost表示他们不提供此功能,但提供了.htaccess apache和php。 If anyone could help I would really appreciate it. 如果有人可以提供帮助,我将非常感激。

firstly DO NOT redirect. 首先不要重定向。 just create the subdomain shop.example.com and in it's root directory put an htaccess file with following code: 只需创建子域shop.example.com并在其根目录中放入带有以下代码的htaccess文件:

RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ http://exampledomain.shopify.com/$1 [NC, L]

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

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