Yii Framework and HTML5 template file together

I have one question:

my website would be localhost/carfinancing/index.php

I have different index.php page right now which is in HTML5 template and Yii is installed in "application" directory.

When I copy paste this directory then localhost/carfinancing/application/web/ shows my yii index page and localhost/carfinancing/application/web/online-car-loan-application shows another page.

Is there way for yii index file to show: localhost/carfinancing/application and for another page, to show: localhost/carfinancing/online-car-loan-application ?

I mean to remove the ‘/web/’ word from the url?

Yes. Point your host to "web" directly using your web server configuration.

If I point host to &quot;web&quot; directly then what about localhost/carfinancing/index.php ?<br />

It has html5 template.

Can you please read the Yii guide first? :)


If you can let me know exactly which section I have to read, I would really appreciate that.

Most of it, actually.

But especially Overview






The ‘index.php’ at the root of the Yii directory: there isn’t any.

You set up your application in Apache/Nginx to have the root in the ‘web’ directory.

In that directory, web, the ‘index.php’ runs Yii.

If you need to customize the template/looks/whatever of the pages that Yii renders, you need to modify the files in the ‘views’ directory.

In the ‘views’ directory, you have a ‘layout’ directory. That’s where you put your HTML5 template and modify it for use with Yii.

Read the guide, because it is not possible to give you an accurate picture of what goes on in a single forum post.

The best way to get started is to generate a couple of basic Yii 2 applications (using the Composer template).

Take a look at the files generated, modify the files, experiment.