Hi,

My solution to this problem was to use two .htaccess files. In the
"mydomain" folder you put the following:

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]

and in your "mydomain/public" you put the following in a .htaccess file:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]



Mantasgl wrote:
> Hi,
>
> I have my Zend Framework application fully working on my PC (localhost). My
> application directory structure is default:
> /myapp
>      /application
>      /library
>      /public
>
> I have configured my apache virtual hosts, so that it point to public
> directory:
> <VirtualHost ∗:80>
> ServerName myapp
> DocumentRoot "D:/wamp/www/myapp/public/"
> </VirtualHost>
>
> I also added the new virtual domain to my hosts file in Windows XP
> 127.0.0.1 myapp
>
> At this point on my localhost everything works fine. In browser i type
> "myapp" and my application starts.
>
> The problem is, when I put my application online on web server, I can't
> change virtual hosts there, so when I type my domain in browser I also have
> to enter to public directory. So my address looks like this:
> "mydomain/public" 
> and in the end I need to change my paths, also form action's paths and so
> on.
> I haven't contacted my web server administrator yet. What I was trying to do
> is that I cut everything out of my public dir and paste it in my root dir
> (myapp) and everything now working fine. But at this point I have to change
> index.php configuration and the default zend framework application structure
> is broken.
> So what can you advice me? Is my solution good? Should I try asking my web
> server administrator to change virtual hosts? 
>   


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to