I am a newbie with Zend framework. How do I run the url of project without the public folder name.I am using a shared hosting server .Anyway to change this by using .htacces ?. I should have the url look like myzfproject.mydomain.com. Please advise me
-
4What does this have to do with Zend? Simple DNS and http daemon configuration solves this for you. – Brad Dec 05 '11 at 05:13
-
@Brad Can you explain a little bit more ? You mean I need to point the url to the public folder ? – Dec 05 '11 at 05:18
-
How can I? You didn't say what web server you are using, nor DNS. I can't explain anything for you, if you can't explain what software you are using. – Brad Dec 05 '11 at 05:19
-
@Brad Thanks.I will check this with server people ,they may have help me. FYI ,I am using linux server hosted on znet – Dec 05 '11 at 05:26
-
1You're using cPanel. Depending on how this is setup, usually you just go and click "subdomains" and add one. In any case, this is no longer appropriate for Stack Overflow. Voting to migrate it to ServerFault.com. Please read the FAQ: http://stackoverflow.com/faq – Brad Dec 05 '11 at 05:28
-
@Brad .Thought I should get a answer with adjusting the .htacces file or index.php so. – Dec 05 '11 at 05:32
-
You thought wrong. This has nothing to do with .htaccess or index.php. – Brad Dec 05 '11 at 14:16
1 Answers
The best solution is to point the site document root to the project's public
directory.
If you are using CPanel (as mentioned in the comments), you can simply add the myzfproject
sub-domain and enter the directory to the public
directory (relative to your home dir) in the Document Root field (ref http://docs.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/SubDomains#Add%20a%20Subdomain).
Another option is to completely separate the public
folder from the rest of the application.
For example, the contents of the public
folder can reside anywhere, say /home/user/sites/myzfproject
which is set as the site document root.
The application can exist anywhere else, say /home/user/apps/myzfproject
with the application
and library
folders within.
The only change required would be to /home/user/sites/myzfproject/index.php
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', '/home/user/apps/myzfproject/application'));
- 168
- 1
- 11
-
1@RintoGeorge: "Thanks Phil for your advise" [*sic.*] is best expressed "[by clicking on the check box outline to the left of the answer.](http://serverfault.com/faq#howtoask)". – johnsyweb Dec 13 '11 at 09:17