That works...but I think a better method is accomplished by setting the following in Apache (either global config or a <Directory> directive):
Alternatively, if you don't have access to the Apache configuration, you can usually use .htaccess files to accomplish roughly the same thing, too (although the site configuration is preferable).