ciber Posted July 9, 2010 Share Posted July 9, 2010 Firstly let me explain my directories: /home/user/public_html/ which makes use of mysite.com /home/user/images/ which makes use of img.mysite.com basically I am splitting my images up, to monitor traffic on them - however, I need them to remain in the directory they are in. Therefore, if a file is accessed img.mysite.com, how can I get the server to rewrite to /home/user/public_html/images/ ? thanks Quote Link to comment Share on other sites More sharing options...
cags Posted July 9, 2010 Share Posted July 9, 2010 The 'correct' way of doing this would not be via mod_rewrite. You should be setting up img.mysite.com with it's own named virtualhost via an apache .conf file. Assuming this isn't an option for you it can be done with mod_rewrite, you'd use something like this.... RewriteCond %{HTTP_HOST} ^img.mysite.com RewriteRule ^.*$ http://mysite.com/images/%{REQUEST_URI} Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.