Solved

Zend Project and web host: file not found problem

Posted on 2011-09-23
3
483 Views
Last Modified: 2013-11-10
hello all,

after i upload my zend project to a webhost, i have problem to let it work.

the root path for my web  host is /home/xxxxx
the domain name is: www.xxx.com
the zend project is under /home/xxxxx/myproject/

i could open the homepage of my project under http://wwww.xxx.com/myproject/public

becaut the index.php is there.

The problem i met is other pages in my project could not be opened, when i click on the link in my homepage, it seems that the file could not be found. Here is MVC Module used.

My question is: what is wrong with this problem and how do i let it fixed:

1.  should i change the root path to /home/xxxxx/myproject/public

2.  is it importent to have access of the .htaccesss file under  /home/xxxxx/myproject/public? and should any change be made there?

3  could you tell me some zend host that you find good.

thanks,
wantime
0
Comment
Question by:wantime
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 

Author Comment

by:wantime
ID: 36586129
i use the suggestion from
http://www.alberton.info/zend_framework_mod_rewrite_shared_hosting.html

now i can access my home page directly under my domain name.

the next problem i get is:  only the first can be displayed correctly, if i click the link on the website, i got error that the file could not be found, and website jump to http://error404.000webhost.com/

any suggestion?
0
 

Accepted Solution

by:
wantime earned 0 total points
ID: 36586219
It works!!!

the problem is that i made some mistake by RewriteRole. I paste the codes from .htaccess here and hope it will help other people who has some problem to save their time.


the folder has following structure:

root /public_html/
 myproject/
   application/
   library/
   public/

root is defined in webhost as "Home Root", and public_html is defined by web host as the default folder for project .

my project  called "myproject". And i have copied it into root/public_html.

now what i need to do is just delete the .htaccess file from myproject/public/.htaccess, and modify the .htaccess from root/public_html/.htaccess. The codes are attached here.

if you have better way to define the .htaccess cause of security issue, please let me know. thanks.
######################################
RewriteEngine On
RewriteBase /
RewriteRule ^\.htaccess$ - [F]
 
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /myproject/public/index.php [NC,L]
 
RewriteCond %{REQUEST_URI} !^/myproject/public/.*$
RewriteRule ^(.*)$ /myproject/public/$1
 
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
 
RewriteRule ^myproject/public/.*$ /myproject/public/index.php [NC,L]
##############################

Open in new window

0
 

Author Closing Comment

by:wantime
ID: 36586232
it works.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question