1
votes

I developed a project in zend framework 1.12 Now I want to deploy it on server. I have a shared hosting. I uploaded all files and folders to public_html folder (application, library, public). When I am opening domain as www.domainname.com it shows all the folders listing, and I need to type as www.domainname.com/public/ then I am able to see my index page.

I can't create virtual host in apache.conf because its on shard hosting.

Please suggest how can I show index page when I type only domain name.

2

2 Answers

0
votes

Create a .htaccess file in your root directory

RewriteEngine on
RewriteRule (.*) public/$1

And add below line to your application/configs/applicaton.ini file

resources.frontController.baseUrl = "/myapp/"

There will be no error It will work fine.

0
votes

You do not need to create virtual host on live server. Put everything in the public folder to public_html folder. Then all other files and folders to outside of the public_html. so structure goes like this:

/
 -config
 -data
 -module
 -pulic_html
   -index.php
 -vendor
 -init_autoloader.php

other zend framework files and folders must be in root folder of your server. That way you can protect all your php files because they are not visible and accessible to visitors.