Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Dec 6 '11 at 2:45

This question came from our site for professional and enthusiast programmers.

4  
What does this have to do with Zend? Simple DNS and http daemon configuration solves this for you. –  Brad Dec 5 '11 at 5:13
    
@Brad Can you explain a little bit more ? You mean I need to point the url to the public folder ? –  Rinto George Dec 5 '11 at 5: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 5 '11 at 5:19
    
@Brad Thanks.I will check this with server people ,they may have help me. FYI ,I am using linux server hosted on znet –  Rinto George Dec 5 '11 at 5:26
1  
You'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: stackoverflow.com/faq –  Brad Dec 5 '11 at 5:28

1 Answer 1

up vote 3 down vote accepted

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'));
share|improve this answer
    
Thanks Phil for your advise –  Rinto George Dec 6 '11 at 4:43
1  
@RintoGeorge: "Thanks Phil for your advise" [sic.] is best expressed "by clicking on the check box outline to the left of the answer.". –  Johnsyweb Dec 13 '11 at 9:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.