# Add the following to your virtual host block (assumes squid runs on the same machine as apache)

 RewriteEngine On

 # use RewriteLog to debug problems with your rewrite rules
 # disable it after you found the error our your harddisk will be filled *very fast*
 #RewriteLog "/var/log/httpd/rewrite_log"
 #RewriteLogLevel 2

 # Normalize URLs by removing trailing /'s
 RewriteRule ^/(.*)/$ http://127.0.0.1:<tal:port replace="squid_port" />/http/%{SERVER_NAME}/80/$1 [L,P]
 # Pass all other urls straight through
 RewriteRule ^/(.*)$  http://127.0.0.1:<tal:port replace="squid_port" />/http/%{SERVER_NAME}/80/$1 [L,P]


# if you have a separate block for handling https requests, add the following lines to it:

 RewriteEngine On

 # use RewriteLog to debug problems with your rewrite rules
 # disable it after you found the error our your harddisk will be filled *very fast*
 #RewriteLog "/var/log/httpd/rewrite_log"
 #RewriteLogLevel 2

 # Normalize URLs by removing trailing /'s
 RewriteRule ^/(.*)/$ http://127.0.0.1:<tal:port replace="squid_port" />/https/%{SERVER_NAME}/443/$1 [L,P]
 # Pass all other urls straight through
 RewriteRule ^/(.*)$  http://127.0.0.1:<tal:port replace="squid_port" />/https/%{SERVER_NAME}/443/$1 [L,P]
