Solved

Zend Project and web host: file not found problem

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP Undefined Index in HTML Form? 2 32
xampp tool 12 28
MySQL Grouping 2 25
Is it okay to create multiple session variables with user data upon login 8 24
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 …
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

867 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

21 Experts available now in Live!

Get 1:1 Help Now