eZ Community » Forums » eZ Publish 5 Platform » VirtualHost, assets and explicit...

VirtualHost, assets and explicit /web/index.php

VirtualHost, assets and explicit /web/index.php

Wednesday 26 June 2013 8:17:35 am - 9 replies

Hi eZ community,

I noticed a probable VirtualHost configuration issue. I have a configured a VHost "ez51.local" using the recommended VHost configuration for eZ 5.1 (https://confluence.ez.no/display/EZP/Virtual+host+setup).

When using http://ez51.local everything works as expected, I see the wonderful ezdemo pagelayout and assets are shown as expected.The rendered HTML code shows correct asset paths (e.g. /bundles/ezdemo/images/logo-ez.png)

When using http://ez51.local/web/index_dev.php , I see a "kernel error (20) module not found" as expected, but without any assets. The rendered HTML code shows wrong assets paths, beginning with "/web/extension/" prefix instead of "/bundles/" (e.g. /web/extension/ezdemo/design/ezdemo/images/logo-ez.png)

When using http://ez51.local/web/index.php , I see the default page but again without assets. This is even more confusing. Rendered HTML code also shows wrong assets paths, beginning with "/web/bundles/" this time (e.g./web/bundles/ezdemo/images/logo-ez.png).

Is this "normal"? Can we avoid it in some way, maybe with a redirect rule from "/web/index*.php" to "/" or the like?

Thanks for suggestions!

Best regards,


Wednesday 26 June 2013 11:39:11 am

Interesting. If confirmed, you should file a bug report to http://jira.ez.no

Wednesday 26 June 2013 12:15:38 pm

Hello Ryad,

Which DocumentRoot did you use in your Virtual Host setup?


Wednesday 26 June 2013 5:29:47 pm


i think you have to fix the index.php and index_dev.php in two Vhosts. 


<Directory [PATH_TO_EZPUBLISH]/web>
DocumentRoot [PATH_TO_EZPUBLISH]/web/
RewriteRule .* /index_dev.php

-> here is per deafault debug on, no cahces and you have the nice symphony2 toolbar


 <span>RewriteRule .* /index.php</span>

-> default: debug off, prod cache active

be sure that you have a symlink  to extensions, var and design in the web folder with:

 php ezpublish/console ezpublish:legacy:assets_install --symlink web

and always deploy you css , js and images from your bundle/../public  in web/bundles/youbundle/public with:

 php ezpublish/console assets:install web

or still use --watch .

Modified on Wednesday 26 June 2013 5:30:42 pm by Ramzi Arfaoui

Thursday 27 June 2013 10:44:45 am

Hey guys,

thanks for the answers.

It doesn't matter, which environment I use, neither dev nor prod works, if I append /web/index.php to the URL. Of course, I work in the dev mode and only use prod for production. Also all assets are installed correctly (using symlink).

Current shorten (prod) configuration:

Hint: "/srv/http" is "/var/www" in Arch Linux.

<Directory /srv/http/ez51/web>
    Options FollowSymLinks
    AllowOverride None

DirectoryIndex index.php

<IfModule mod_rewrite.c>
    RewriteRule .* /index.php

DocumentRoot /srv/http/ez51/web/
ServerName ez51.local
ServerAlias *.ez51.local

I guess the configuration is correct. This issue is  reproducible on all eZ5 systems we develop currently. Probably you can  reproduce the same.


Modified on Thursday 27 June 2013 10:51:11 am by Ryad-Marcel El-Dajani

Thursday 27 June 2013 11:02:53 am

Hello Ryad,

You already point to the /web folder in your DocumentRoot, you don't need to specify it in your url. In this way you are searching for a non existing route


Thursday 27 June 2013 11:27:11 am

@gabriele yes, but even if you use a non-existing route in your url, the links to asssets shown in the html error page should be fine

Thursday 27 June 2013 1:42:16 pm

Correct, sorry Ryad, you already mention what I'm saying in your first post.

By the way, I'm not able to reproduce the problem, on my installation (2013.05) assets are shown correctly also using http://myhost/web/index.php


Thursday 27 June 2013 10:37:01 pm

web/index.php should not appear in the dev or prod environemnt URL. The absolut URL (http://myhost) musst works directly if you use VirtualHost pointing to web folder. The generated HTML code can help you to find some bugs . if some css , js or images are not reachable

Friday 28 June 2013 8:04:13 am

Good morning guys,

correct Ramzi, normally you wouldn't type http://host/web/index.php and http://host works as expected as mentioned in the first post. But if, for some reason, http://host/web/index.php is typed, there should be just a "module not found" error or something similar.

I'm really confused, that we have four eZ installations and on all the similar issue. But I'm still glad you have not Gabriele happy.gif Emoticon

It's not a big deal for the moment, but I guess, we have to put some research into that issue. It's not possible to seriously go live with such a glitch.

Have a nice day!


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from