I've been working on getting my portal's custom domain to work for a few hours and can't figure it out. I feel like I'm super close right now but when I go to my custom URL portal.my-domain.com, it just shows 2025 EspoCRM in the corner with no login box or anything else on the page. I must be getting close since Im not getting 403 or 404 errors any more. I've been reading and re-reading everything on the documentation page for setting up custom URLs in Apache servers (Configuring Portal in Apache - EspoCRM Documentation) and put the code into the .htaccess file in public/portal but I'm not sure if that's the right place. Is anyone familiar where I should be putting the code? In one of the .htaccess files? Should it be at the top or bottom of the file? Or within one of the existing parameter?
Can't Get Custom URL to Work in Portal
Collapse
X
-
Tags: None
-
Found it's because the symlink I made wasn't loading the JS/CSS. Got my custom URL working finally and will share what I did below in case anyone is having trouble or wants some kind of workaround if they're having issues. Not sure if I made it more complicated than it needs to be, but I'm not much of a coder and it works for my setup. If any devs see an issue with it feel free to let me know! Had to do some serious problem solving lol.
1. SSH'd to my server in terminal and navigated to .../my-domain.com/html/
2. created a portal symlink in the my-domain.com/html/ folder which points to the EspoCRM's .../public/portal folder:
ln -s /path_to_espo/public/portal portal
chmod 755 portal
At this point, visiting portal.my-domain.com will actually serve files from /path_to_espo/public/portal
3. Changed the .htaccess file at /path_to_espo/public/portal/.htaccess:
# ──────────────────────────────────────────────────
<IfModule mod_rewrite.c>
RewriteEngine On
# Tell EspoCRM which portal to load:
RewriteRule .* - [E=ESPO_PORTAL_ID:YOUR_PORTAL_ID]
# Route any request for a non‐existent file to index.php:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
</IfModule>
# Block direct attempts to fetch web.config:
RewriteRule /?web\.config - [F]
# ──────────────────────────────────────────────────
4. Created "Client" and "API" symlinks inside EspoCRM's .../public/portal folder. EspoCRM’s portal front‐end (CSS/JS) lives under /path_to_espo/client/, and its REST API lives under /public/api/v1/. Since portal root folder is /path_to_espo/public/portal, I made two symlinks inside that folder:
cd /path_to_espo/public/portal
ln -s /path_to_espo//client client
ln -s /path_to_espo//public/api api
chmod -R 755 /path_to_espo/public/portal find /path_to_espo/public/portal -type f -exec chmod 644 {} \;
the portal.my-domain.com subdomain is now serving properly through the smylink to /path_to_espo/public/portal and the symlinks in that directory are serving CSS/JS through the symlinks to the API and Client. folders
Comment