![]() |
|
|||
|
I'm new to ZF, and I'm working on a project where we have a deployable application. In most cases the application will live in a document root (http://host/index.php), and I understand that part of it.
But we are contemplating what would happen if a user tried to install in a subdirectory, such as http://host/username/index.php It seems to me that if I set the RewriteBase to /username, then ZF will automatically rewrite all of the URLs in the application; for example, if I link to /controller/action in this example, ZF will rewrite that link to /username/controller/action. Is that correct? Assuming the above is correct, then here's my question: How do I handle links to non-script files? Assume that I'm using a rewrite rule like this: Code:
Alias /username /path/to/my/doc/root RewriteEngine on RewriteBase /username RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php Hopefully this is clear... we're having a debate among our developers how best to handle this. Some are convinced that ZF's native handling will work fine, and others are convinced that we need to prepend the base URL to every link that we create (which means modifying thousands of lines of code). I'm a ZF newbie so I have no idea but I'm trying to research it. Thanks, |
|
|||
|
The way I am currently rerouting image paths for my view files are
echo "<img src='" . $this->baseUrl() . "/images/funnyforum.jpg'/>"; where baseURL is class Zend_View_Helper_BaseUrl { function baseUrl() { $fc = Zend_Controller_Front::getInstance(); return $fc->getBaseUrl(); } } do you know if this is the best way to do this? |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
| Designed by: Miner Skinz |
Powered by vBulletin® Version 3.8.4 Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Search Engine Friendly URLs by vBSEO 3.1.0 |
![]() |