0

I am in the process of converting an old legacy website to zend framework, however I will be using lighttpd instead of apache for my web server and lighttpd doesn't support the .htaccess file which is where I would normally add all my rewrites, I have a couple of questions:

  1. Where is the best place to put all these rewrites, we are talking about close to 200 redirects, lighttpd configuration file or the bootstrap?

  2. Which method would be better as far as performance?

1
  • 1
    How many requests are you expecting? Imho, I would place it where ever it is good to handle for you, this is certainly not the bottleneck. Invest your time to optimize other issues. Commented Jan 5, 2012 at 1:12

1 Answer 1

1

I use the bootstrap to do it, but I only had like 10 rewrites, so the only question here is whether you prefer to have them in the bootstrap (with your other config) and since most editors/IDEs will let you collapse the blocks of your code you won't really have a problem managing them, or you can create a separate file to do this.

I would advice you to create a separate file especially if your bootstrap might be a bit different in your development environment and your production one.

Sign up to request clarification or add additional context in comments.

1 Comment

I decided to create a separate .ini file to handle all my rewrites and then load it in the bootstrap using Zend_Config_Ini, like this: $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/rewrites.ini', APPLICATION_ENV); $router = new Zend_Controller_Router_Rewrite(); $router->addConfig($config, 'routes'); I think this method might be easier for me to manage and not overload my bootstrap file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.