Hi everyone,
I am using Dolibarr v23.0.2 and having trouble with the Website Module.
My Setup:
-
ERP Path:
/public_html/erp/(Subdomain:erp.expotradersbd.com) -
Target Website:
https://expotradersbd.com(Root domain) -
Data Path:
/home/expotfya/dolibarrdata/
The Problem: I have successfully regenerated all 18 pages. The text content is showing up correctly on the root domain, but all images, CSS, and JS files are returning 404 errors.
What I have tried so far:
-
I created an
index.phpin the root to include the generated files fromdolibarrdata/website/. -
I configured
.htaccessto redirecttheme/andincludes/to the ERP folder. -
I set
WEBSITE_FORCE_RELATIVE_URLSto1in Other Setup. -
I cleared all browser caches and regenerated the site multiple times.
The Error: My browser console shows that it’s looking for images at: expotradersbd.com/medias/image/www.expotradersbd.com/background.jpg But this returns a 404 Not Found. It seems the root index.php doesn’t know how to handle the /medias/ requests and pass them to Dolibarr’s viewimg.php correctly.
Request: Can anyone provide the exact logic for the root index.php and .htaccess so that it correctly serves media files and CSS when the site is accessed via the root domain while the ERP is in a subdirectory?




