Enonic redirects to admin

Enonic version: 6.9.2
OS: Ubuntu

Hi

Enonic server is redirecting to admin for some reason.

http://www.dreampartiesdecorations.com

Is there anything wrong with my vhost file ?

vhost

enabled = true

mapping.a.host = dreampartiesdecorations.com 
mapping.a.source = /admin
mapping.a.target = /admin
mapping.a.userStore = system

mapping.b.host = dreampartiesdecorations.com
mapping.b.source = /
mapping.b.target = /portal/master/dream-party-decorations

Hi,

Are you sure the vhost file you pasted here is used and the one used?
From the behaviour of your site, it behaves like if the vhost mapping was disabled (which could happen if your file “com.enonic.xp.web.vhost.cfg” was not found for example).

Hi gri

yes, the server is using this vhost. I tested by setting enable to false and back to true again.

16:49:36.320 INFO  c.e.x.l.i.framework.FrameworkService - Started Enonic XP in 10853 ms
16:49:41.935 WARN  c.e.x.w.vhost.impl.VirtualHostFilter - Virtual host mapping could not be resolved: www.dreampartiesdecorations.com
16:50:16.275 INFO  c.e.x.s.i.config.ConfigInstallerImpl - Loaded config for [com.enonic.xp.web.vhost]
16:51:06.825 INFO  c.e.x.w.v.i.c.VirtualHostConfigImpl - Virtual host is enabled and mappings updated.
16:51:06.830 INFO  c.e.x.s.i.config.ConfigInstallerImpl - Loaded config for [com.enonic.xp.web.vhost]

I am getting a different error after I reboot the server, it says “Virtual host mapping could not be resolved: www.dreampartiesdecorations.com” and I can’t access the server anymore. It returns HTTP ERROR 404.

What could it be ?

Hello.

The virtual host was disabled before (thus the behaviour and redirection to /admin).

Now it is enabled but your problem is in your vhost config: The host should be “www.dreampartiesdecorations.com” and not “dreampartiesdecorations.com” (It will also work for dreampartiesdecorations.com also since you seem to have a redirection from “dreampartiesdecorations.com” to “www.dreampartiesdecorations.com”).

1 Like

spot on! Adding “www” did the trick. Thank you for that.

3 Likes