Just wanted to know, what u guys think.

is it better to use a .htacces or is it better to configurate the server.

i heared that using a .htaccess is not "good" for the performance. it should slow doen that a little bit.

an i rather wanted to know if someone can get acces to .htaccess even if it’s in the protected folder.


Note: Using URL rules will degrade application performance. This is because when parsing the request URL, CUrlManager will attempt to match it with each rule until one can be applied. The more the number of rules, the more the performance impact. Therefore, a high-traffic Web application should minimize its use of URL rules.

If I wanted to create a site similar to Facebook style whereby it does a check for the username in the URL, for example: myfacebook.com/username

Would this be better done in htaccess or rules?

yeah. that’s right.

but note that u declare the rules in the main.php under protected/config.

an i just asked if its better using .htaccess or to configurate the server directly in vhosts without a .htaccess

.htaccess is obviously more flexible. Performance impact is not significant since there are other things that have much more impact on the loading time (database, opcode-caching etc).

Doesn’t make sense to add any special rules to the htaccess. The urlmanager should do the work. Then it’s also easier to switch webservers later.

On high performance sites you’ll want to avoid AllowOverride (== enable .htaccess) as Apache needs to search for .htaccess files on every request - including all higher-level directories(!!!).

So to squeeze out every inch of performance it’s better to disable them.

Also read here:


But agree with Y!!: For most sites this will not really make a difference. But if you need to do some serious tuning (and minimizing disk access is a crucial part here) it’s an important option, that one should keep in mind.