htaccess correctly set up for zend framework 1.11

For programming and general questions on Zend Framework

htaccess correctly set up for zend framework 1.11

Postby new_bobo_time on Wed Sep 12, 2012 10:49 am

Hello guys,
I need your help before crazy.
I'm beginning to use ZF, I have to configure the application without virtualize the server, and then setting the htaccess file. I found online different code but unfortunately with all the ones I tried I get "Error 404" can anyone help me please?

My environment was created with xampp 1.7.7 and zend framework version 1.11

thanks in advance for your contributions

Bob Time




.
new_bobo_time
 
Posts: 7
Joined: Wed Sep 12, 2012 10:34 am

Re: htaccess correctly set up for zend framework 1.11

Postby new_bobo_time on Fri Sep 14, 2012 3:46 pm

probably I have not explained well.
This is the link where I got the code to set the application as root public folder, although not virtualize the server, but it does not work I would return "error 404"
http://www.alberton.info/zend_framework_mod_rewrite_shared_hosting.html

this is the code:
Code: Select all
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ /public/index.php [NC,L]



help me please?



.
new_bobo_time
 
Posts: 7
Joined: Wed Sep 12, 2012 10:34 am

Re: htaccess correctly set up for zend framework 1.11

Postby us2rn4m2 on Fri Sep 14, 2012 5:10 pm

Hi,

I'm not an 'htaccess expert' but i just can tell you that i use the same .htaccess file for an online website and it works.
I have created a zf project with Zend Tool for you call 'zfproject'. There are inside everything you need to get started with Zend. Download it and compare with yours or extract it directly into your root server (www or htdocs) and go to url: 'http://localhost/zfproject/public/'
Attachments
zfproject.zip
(9.54 KiB) Downloaded 415 times
us2rn4m2
 
Posts: 49
Joined: Mon Jun 18, 2012 12:41 am

Re: htaccess correctly set up for zend framework 1.11

Postby new_bobo_time on Mon Sep 17, 2012 4:50 pm

sorry, it is strange that work it without web server virtualized, if you do not change the document root (in apache httpd.conf) or if you do not use a. htaccess located directly in the root of the project.
Obviously I have the problem of having to disclose only the folder / public on a web server with multiple domains shared, let me explain better;
if you type the url: http://www.mywebsite.com should not come out of the root of the project with all folders (applications, docs, library, public, tests, etc..) but must point directly to the file index (bootstrap) " / public/index.php", I hope I explained myself.




.
new_bobo_time
 
Posts: 7
Joined: Wed Sep 12, 2012 10:34 am

Re: htaccess correctly set up for zend framework 1.11

Postby new_bobo_time on Tue Sep 18, 2012 10:49 am

I'm taking small steps to improve the setting, but still does not work redirect with htaccess file.
I modified the htaccess code that I found here: http://www.alberton.info/zend_framework_mod_rewrite_shared_hosting.html
in this mode:

Code: Select all
SetEnv APPLICATION_ENV production

RewriteEngine On

RewriteRule ^\.htaccess$ - [F]
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /ZF/quickstart/public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/ZF/quickstart/public/.*$
RewriteRule ^(.*)$ /ZF/quickstart/public/$1
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ /ZF/quickstart/public/index.php [NC,L]


I set the project (tutorial) quickstart, now if I enter a URI http://localhost/ZF/quickstart/ directs me correctly on the index.php (which is the bootstrap) and hide the rest of the project structure.
I can see the link in the guestbook but I have always an error "An error occurred Page not found " and does not work the Zend controller.
If I enter the full address to public, that is: http://localhost/ZF/quickstart/public, everything works!
How do I set the htaccess file so that it always references to this path?

Help me, please =:¬((


.
new_bobo_time
 
Posts: 7
Joined: Wed Sep 12, 2012 10:34 am

Re: htaccess correctly set up for zend framework 1.11

Postby us2rn4m2 on Tue Sep 18, 2012 9:27 pm

This .htaccess file from http://www.alberton.info/zend_framework ... sting.html is for an Online website !

Now for a Local website if your wish is to hide the 'public folder' in the url and at the same time all request point directly to 'public/index.php'

download My customized ZendFrameworkQuickstart
ZendFrameworkQuickstart.zip
(20.19 KiB) Downloaded 406 times

extract directly on your root server (www or htdocs) and go to url
Code: Select all
http://localhost/ZendFrameworkQuickstart/
http://localhost/ZendFrameworkQuickstart/guestbook
http://localhost/ZendFrameworkQuickstart/guestbook/sign

That's what you want ?
us2rn4m2
 
Posts: 49
Joined: Mon Jun 18, 2012 12:41 am

Re: htaccess correctly set up for zend framework 1.11

Postby new_bobo_time on Wed Sep 19, 2012 11:05 am

Exactly !! thank you very much !!


.
new_bobo_time
 
Posts: 7
Joined: Wed Sep 12, 2012 10:34 am

Re: htaccess correctly set up for zend framework 1.11

Postby new_bobo_time on Thu Sep 20, 2012 9:06 am

what ???????????????
new_bobo_time
 
Posts: 7
Joined: Wed Sep 12, 2012 10:34 am

Re: htaccess correctly set up for zend framework 1.11

Postby new_bobo_time on Thu Sep 20, 2012 3:45 pm

now I have another problem.
In local works, but now that I've loaded on-line (production server) I do not display anything, blank page !!!

any suggestions, please ???

thanks in advance.
new_bobo_time
 
Posts: 7
Joined: Wed Sep 12, 2012 10:34 am


Return to Zend Framework

Who is online

Users browsing this forum: No registered users and 4 guests