Hi,
I really like the alternate _dev frontcontroller and I usually also end
up with a set of other files that should only be callable by certain
people. Now the natural thing to do would be to add another directory
next to the web directory (or in other words into the symfony project
root), move those files there and configure apache to access those from
admin.example.com or something like that. This vhost can be secured by
only allowing certain hosts, adding a .htaccess restrictions or whatever
means in a fairly flexible manner.
Only that this is not so easy if you are using absolute paths any where
(like for your assets, redirects and stuff like that). I needed this
quickly so I wrote up an ugly hack that would modify $_SERVER accordingly.
$dirname = 'admin';
// production case
if (strpos($_SERVER['SCRIPT_NAME'], $dirname.'.')) {
$_SERVER['REQUEST_URI'] = str_replace($dirname.'.', '',
$_SERVER['REQUEST_URI']);
$_SERVER['SCRIPT_NAME'] = str_replace($dirname.'.', '',
$_SERVER['SCRIPT_NAME']);
// developer case
} else {
$_SERVER['REQUEST_URI'] = str_replace('/'.$dirname, '/web',
$_SERVER['REQUEST_URI']);
$_SERVER['SCRIPT_NAME'] = str_replace('/'.$dirname, '/web',
$_SERVER['SCRIPT_NAME']);
}
The development case when I do not bother to setup a vhost. I am sure
there is a cleaner/better solution. Ideas?
regards,
Lukas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---