简体   繁体   中英

Zend and web hosting - subdirectory appearing as root

I have learned how to create a simple website with the Zend Framework. Now suppose I want to put it on some web hosting server. In my ZF project, I have a folder named public , which I want to appear as the root of the URL. I want my site to be visible and accessible as

http://www.mysite.com

while being served from a page like /public/index.phtml or similar.

How is this done?

If You want domain like www.mysite.com, u must buy somewhere one (for example ovh.org), there is not free *.com domain. After that u could direct domain to your host computer (nice free hosting: 60free.ovh.org). There is PHP of course, so i think you could install Zend there.

You have to put the public_html files you're using with Zend_Framework in the root folder of your host. The host server will give you a folder which will be the root for that domain, put in there and you will not have /public/index.phtml in front of your domain name.

Do you already have a hosting server or are you looking for one?

Usually you can achieve your goal by using the tools provided by your hosting provider, some allow you to change the directory from which http://www.yoursite.com is server, set that to /public and you are done.

It really depends on the provider.

You'll need to deploy the entire Zend Framework directory structure to the host you end up using. In your Zend Framework directory structure, you have your public directory. This directory will need to be the one that your web server looks at as your document root. The setup for this is probably different based on which host you use. Some will have web interfaces and others will force you to edit an httpd.conf file.

I'm using Rackspace for our site and the default web location is /var/www/html/. We've deployed the entire site here so we have the following directories: /var/www/html/application /var/www/html/library /var/www/html/public /var/www/html/scripts

We then had to change our Apache config to point to /var/www/html/public instead of /var/www/html.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM