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.

1 Answer
1

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.

It's actually just 2 files really. It's just that I don't want to mess with the source code because I would need to change it whenever I upgrade to a newer version. I had to adapt your solution RewriteRule ^/?(html/\w+\.(js|css))$ /admin/$1 [L] but it worked :)
–
Ricardo AmaralJan 17 '10 at 2:02