I have the following in my Apache config:

&lt;VirtualHost *:80&gt;
  VirtualDocumentRoot /var/www/hosts/%0
  ServerAlias *.test.galapagos.office
&lt;/VirtualHost&gt;


In /var/www/hosts, I have a directory called jason.test.galapagos.office and one called bill.test.galapagos.office. If I go to jason.test.galapagos.office in a browser, I get what I expect to see. Same with bill. In other words, everything is working perfectly.

However, I'm not quite satisfied with what's going on. Instead of /var/www/hosts/jason.test.galapagos.office and /var/www/hosts/bill.test.galapagos.office/, I'd like /home/jason/web and /home/bill/web.

How can I tell Apache to map to those subdirectories instead?

Thanks,
Jason


Question: Capture all queries that use hints
Answer: That's not possible in retrospect.

You need to actively log the queries with SQL Profiler where you can export and filter on the queries with hints. Or use server-side trace for long running traces.

You can come close by inspecting the cached execution plans. 

This will show most queries but remember that some aren't cached and that sql server can remove them from the cache if it's under pressure. Use this query to list them:

SELECT [cp].[refcounts] 
, [cp].[usecounts] 
, [cp].[objtype] 
, [st].[dbid] 
, [st].[objectid] 
, [st].[text] 
, [qp].[query_plan] 
FROM sys.dm_exec_cached_plans cp 
CROSS APPLY sys.dm_exec_sql_text ( cp.plan_handle ) st 
CROSS APPLY sys.dm_exec_query_plan ( cp.plan_handle ) qp ;


You can use a where clause with a regex (clr function) so that false positives are minimized close to 0.