API DNS IP url rewriting

The omeka website is working fine with url rewriting etc.
But the API has a different behaviour: the IP is not rewritten as the DNS, so it causes SSL certificate error.

I can’t figure where the problem is. Is it on omeka .htaccess ? in the apache2config?

I’m not sure quite what you’re experiencing here… I don’t see any issue with the API from what I can see.

I think you’re saying you have Apache set up to redirect people who visit directly on the IP address to the domain name you linked to above here. If so, that’s likely going to be an issue of the Apache configuration if there’s some problem with it, not something to do with Omeka itself.

Thank you for your answers.
My question was unclear. Sorry for that.
Let me try to ask again :
" Is it a normal behaviour to have omeka-s REST API serving the URL with IP adress instead of DNS?"

My apache config doesn’t provide ssl cert for requests directly on IP (It’s maybe not usual, but this not my question).
Then I have:
https://epotec.univ-nantes.fr/api/items/86 → SSL OK → SSL error
Using CRUD scripts on my data is then not possible through SSL.
Still I’m managing it with workarounds, but I wonder why the REST-API serves direct IP? is it a “feature”?

There’s no feature for doing this. What’s happening here is probably that you’re doing your URL “rewrite” with a proxy of some sort?

Omeka S in general will respond with URLs using the hostname you accessed it with. The URLs you’re seeing here indicate that the host as the Omeka S server sees it is just the IP address: this is typically the result of having a proxy set up where users connect to a server with the “real” domain name, and that server connects to another server that hosts the actual Omeka S install.

If this is what your setup looks like, one solution is to configure your proxy to pass through the Host header.

Oh great!
It’s exactly my case I have a VM behind reverse proxy (sadly, I’m not managing this part :frowning: )
thank you for the advice. I’ll ask help to go this way.