The name does not seem to correspond to the question at the end of your description, but to answer the last: if you have problems with your resources (images, css, external javascript, etc.) after rewriting the URL, use the absolute path, for example:
/subfolder/login/style.css
instead of something like:
../style.css /* this will probably not work when rewriting urls */
source share