使用的.htaccess来掩盖一个子域名重定向到shopify.com个子、重定向、域名、htaccess

2023-09-02 01:09:12 作者:猫咪つ

我目前使用BlueHost的一个注册我的域的 www.exampledomain.com 的。我用BlueHost的C-面板,使一个子域的 shop.exampledomain.com 的重定向到创建一个子域重定向的 exampledomain.myshopify.com 的

I am currently using bluehost a registrar for my domain www.exampledomain.com. I created a sub-domain redirect using bluehost C-panel to make a sub domain shop.exampledomain.com that redirects to exampledomain.myshopify.com

我要的子域名的URL来掩盖shopify域名的URL。所以,如果你从根本上点击店铺,它会重定向到子域的 shop.exampledomain.com 的,重新写这篇文章的每一个URL掩盖的 exampledomain.myshopify.com

I want the url of the sub-domain to mask the url of the shopify domain. 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

我之前已经使用GoDaddy的,他们提供了一个功能,这样做,但我不能做转移到电子邮件设置。 BlueHost的说,他们不提供这项功能,但他们提供的.htaccess Apache和PHP。如果有人可以帮助我真的AP preciate吧。

I have used godaddy before and they offer a feature that does this, but I can't transfer do to an e-mail setup. Bluehost says they do not offer this feature, but they do offer .htaccess apache and php. If anyone could help I would really appreciate it.

推荐答案

首先不重定向。只需要创建一个子域 shop.example.com ,并在它的根目录下放置一个htaccess文件,下面的code:

firstly DO NOT redirect. just create the subdomain shop.example.com and in it's root directory put an htaccess file with following code:

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