Integrate static website and Yii project.

I have a static html website that would like to integrate it with one action of a Yii project (i.e. /orders.html and /controllers/orderController::actionIndex). They were developed separately and each have its own visual design and css styles.

What are my options?

I think I could serve the whole website as a static set of pages of the yii project, is there another way?


May be you can make use of theming -

Maybe use the yii project as a REST API and just call the actions from the static website using jQuery or something similar

Maybe run them side-by-side and divide the traffic via .htaccess?

I suppose this is the option I stated.

The app is already REST so we are halfway there, but given that they both will reside on the same server, this approach seems a bit overwork and too uncoupled.

Can you explain this further? I think it implies some mod rewrite.

Let me explain a bit more.

The website path is intended to be: /

The yii project is intended to be: /project

The project is basically a restricted access admin panel that handles customer orders, but it needs to serve a "public page" where customers can submit orders (intended path to be /orders.html).

Thanks for your replies. I’m still looking into the best option for this.

Yes, it does. Basically you would redirect requests from "/orders.html" to whatever the appropriate Yii route in "/project" is.

You’ll find a lot about redirection via htaccess on your favourite search engine. Be prepared though that it is a bit of a world of pain - works well once you got it running though.

So i think in this approach i would use theming for /project/index.php?r=customer/orders

Could css be reused from /css (not project/web/css)?

What about the document root? In a basic template it would normally it would point to /project/web but in this case we still have the static site is in /

Not sure if you really need theming - maybe just a different layout?

Yes, of course.

Where do you see the problem?

Do you have experience with .htaccess? If not, play around with it a bit - gives you an idea of how it works.

layouts seems cool

I was about to say that unless i created a subdomain for the yii project like, there would only be one document root pointing to / where the static site is being served. And that the project files would be exposed in /project/web.

Until i remembered this i have used symlinks before, so i think they’ll do.

Not recently, but I shouldn’t have major issues once i put my hands on it.

Very valuable information Sir Patrick Jones. Now I feel more confident of what’s ahead of me.