I'm trying to use mod rewrite to redirect a subdomain to a file with a parameter in a folder.
The website is in a folder /new in the root.
My .htaccess right now is (placed in the root)
RewriteEngine on
RewriteCond %{HTTP_HOST} ^[www\.]*new.mydomain.com [NC]
RewriteCond %{REQUEST_URI} !^/new/.*
RewriteRule ^(.*) /new/index.php?cust_id=1807
This is working, it redirects the browser to the right file with the parameter but it breaks all css, js and image links. I know using absolute paths or setting a basepath can solve this easily but I would like to keep using relative paths and get this to work.
e.g. The source now links to css as follows: http://new.mydomain.com/css/file.css while it should be http://new.mydomain.com/new/css/file.css
Thanks in advance!
Edit: Excluding css and image files won't solve this as they are located in e.g. /new/css