I have a directory structure in my Php mvc app that is currently like this
/site.com
.htaccess
index.php
/models
/views..
/controllers..
/resources..
/images..
/misc..
logo.png
/products..
product_image1.jpg
/js..
/css..
I want to move the resources folder to its own subdomain so the structure would resemble this
/site.com
.htaccess
index.php
/models
/views..
/controllers..
/resources.site.com
/images..
/misc..
logo.png
/products..
product_image1.jpg
/js..
/css..
I need to know the rewrite rule that redirect requests for anything in the resources folder to the new subdomain instead.
I have tried this rule and a few others but it isn't working.
RewriteEngine On
RewriteBase /resources
RewriteCond %{HTTP_HOST} ^resources$ [NC]
RewriteRule ^(.*)$ http://localhost/resources.site.com/$1 [L]
Any help would be much appreciated. Thanks