Solved

Zend Project and web host: file not found problem

Posted on 2011-09-23
3
482 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 Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP Query return divisible by 3 3 25
Creating Functions in phpMyAdmin 8 26
Log in through ID 5 17
check mysql insert 12 26
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to dynamically set the form action using jQuery.
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…

789 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