API explorer gives me 404 on css/js lib files with Apache

Hi all,

I’ve been using Dolibarr for a while now and love it. Now I’m trying to link it to some automation software we have, and have activated the API module.

When I try to access https:///api/index.php/explorer/, I get a ton of 404s for things like
https://(myurl)/api/index.php/explorer/css/typography.css
https://(myurl)/api/index.php/explorer/lib/jquery-1.8.0.min.js

and many other css and js libraries it tries to load. I’m not sure if these URLs are wrong or are supposed to look like this.

My apache config looks like this:


<VirtualHost *:80>
     ServerAdmin <email>
     ServerName <domain>
     DocumentRoot /srv/<path to dolibarr>/htdocs/

     <Directory /srv/<path to dolibarr>/htdocs>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
     </Directory>

     ErrorLog /var/log/apache2/<domain>.log
     CustomLog /var/log/apache2/<domain> combined
	RewriteEngine on
	RewriteCond %{SERVER_NAME} =<domain>
	RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

If anyone has any idea what is wrong, I would very much appreciate it. I’m on version 13.0.2.

Google only brought up problems with Nginx, and even amongst those, nothing that I could connect with my problem.

I was able to work around this by adding Alias’es for /api/index.php/explorer/lib and /api/index.php/explorer/css to my Apache config and pointing them to the appropriate Restler folders.

Actually calling API methods produces a 404 as well though, e.g. https://(domain)/api/index.php/tickets?sortfield=t.rowid&sortorder=ASC&limit=100 - so something clearly is still amiss.

Your virtual host redirect to another https instance. What is your virtual host files for the https domain ?