[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 494
  • Last Modified:

Zend Project and web host: file not found problem

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
wantime
Asked:
wantime
  • 3
1 Solution
 
wantimeAuthor Commented:
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
 
wantimeAuthor Commented:
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
 
wantimeAuthor Commented:
it works.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now