troubleshooting Question

rewrite form any subdomain to media subdomain

Avatar of jeremyBass26
jeremyBass26Flag for United States of America asked on
Web Languages and StandardsApache Web ServerWeb Servers
21 Comments1 Solution1078 ViewsLast Modified:
Hello, I want to have only .jpgs and what not to come out of the subdomain "media" regardless of where the request cam e from.. www. or no subdomain defined at all.. Here is what I was trying.. Not seeming to work... Thank you for the help...

Cheers
Jeremy


<FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf|mp3|wav|js|css|kml|xml)$">
# force CMSMS media Subdomain IN URL
RewriteCond %{HTTP_HOST} ([^.]+)\.tgminvestmentsllc.com[NC]
RewriteRule ^(.*)$ http://media.%{HTTP_HOST}/$1 [R=301,L]
# END CMSMS media Subdomain IN URL
</FilesMatch>
<FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf|mp3|wav|js|css|kml|xml)$">
# force CMSMS media Subdomain IN URL 
RewriteCond %{HTTP_HOST} ([^.]+)\.tgminvestmentsllc.com[NC] 
RewriteRule ^(.*)$ http://media.%{HTTP_HOST}/$1 [R=301,L] 
# END CMSMS media Subdomain IN URL 
</FilesMatch>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 21 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 21 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros