Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

let's say that i have the following directory structure

site
lib
versions
  /1.0
     /application
     /library
     /public

and my site root is mydomain.com

i would like all request to mydomain.com to be redirected to mydomain.com/versions/1.0/public , whilst keeping the request url to mydomain.com

my server is on Dreamhost and with them i simply point my site root to the public folder, but my current client's host doesn't offer this facility. what would be the best way to achieve this?

also , since i'm using ZendFramework , the public folder contains a .htaccess file with the following rules i wish to avoid conflicting with.

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

thanks for your help!

share|improve this question

1 Answer 1

Adding this to your root directory should have the intended effect, though there may be a more graceful way of doing it:

RewriteCond %{REQUEST_URI} !^/public [NC]
RewriteCond %{REQUEST_URI} !^/library [NC]
RewriteCond %{REQUEST_URI} !^/application [NC]
RewriteCond %{REQUEST_URI} !^/site [NC]
RewriteCond %{REQUEST_URI} !^/lib [NC]
RewriteRule ^(.*)$ /versions/1.0/public/$1
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.