Solved

Zend Project and web host: file not found problem

Posted on 2011-09-23
3
477 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
  • 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now