Hi, I’m using HostGator to host my custom domain. I have a subdomain (let’s call it sub.dom.com). In the Obsidian Publish > Site options > Configure custom domain, I specify the custom url as sub.dom.com. (When I go to https://publish.obsidian.md/serve?url=sub.dom.com/ it displays the pages as expected).

But now I want to be able to access this page from my subdomain.

The official Obsidian docs use an example for a sub-url path (dom.com/my-notes), but I want to go from the subdomain sub.dom.com to my Obsidian publish instead.

In the .htaccess file for sub.dom.com, I can’t figure out how to make it work. I’ve tried:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://publish.obsidian.md/serve?url=sub.dom.com/ [P]

and

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://publish.obsidian.md/$1

But they both don’t work. When I remove the Rewrite condition, I get a 500 error.

Thank you in advance for your help!

I don’t know anything about HostGator, but I recently did the same thing with Bluehost. Do you have SSL configured for your subdomain, or a wildcard certificate for your domain? That was the issue for me. In the end, I had to spin up an Nginx server with an SSL cert to act as a reverse proxy between Bluehost and Obsidian Publish.

I do have SSL configured for my subdomain already… I may look into using NGINX server anyways

Hi @kebonly
I have the same type of problems when following the instructions given for Apache server setup.
Did you get to the bottom of it?