# Rewrite modx login page (weblogin snippet) requests. In order for it to work we need to deal with "friendly urls" but not hide the modx site root.
RewriteCond %{QUERY_STRING} loginpage=true [OR]
RewriteCond %{QUERY_STRING} webloginmode=lo
RewriteRule ^/modx/(.*) /modx/index.php?q=$1 [QSA,PT,L]
return '<base href="http://'.$_SERVER['HTTP_HOST'].'/"/>';
RewriteRule ^(.*)/assets/(.*) /modx/assets/$1 [PT,L]
The proper way to do this is to put <base href="[(site_url)]"></base> at the top of your template’s HEAD element. This anchors all your pages at the site root so all paths are then relative to the site root, regardless of where it’s deployed or moved.
This discussion is closed to further replies. Keep calm and carry on.