I have the following code in the .htaccess file located in the root of some subdomain, for instance, http://demo.example.com:
RewriteEngine on
RewriteRule ^$ /admin/index.php?q=user/nazgulled [L]
When someone access http://demo.example.com, they will be redirected to the URL above. Which is an HTML page. But this HTML page is using relative address for things like images, CSS code and JavaScript code. They are not working because it cannot find the files in the current directory (subdomain root). They are located on the "admin" folder.
How can I make this work changing only the .htaccess file?
Can you add something like this above that line?
This is just a guess, but it sounds like you're needing to re-map the things back from the "root" into your path. I think, though, you're headed down a path of hacks. You'd have to do the same thing for .js, then likely images, uploaded files, etc. I suspect it may be faster to change the HTML to map to where they really live.