RewriteRule ^/*$ /root [L]
This is OK, however, whether this works is dependent on how your CMS reads the requested URL. The CMS will most likely be reading the originally requested URL (that's included in the HTTP request headers), not the URL that has been internally written to. So, the CMS sees /
, not /root
. And if it doesn't see /
as a valid route then you get a 404.
Most CMSs would break if they read the rewritten URL, since most CMSs use a front-controller pattern and internally rewrite all requests to a common script (the "front-controller"). Reading the rewritten URL in this case will serve no purpose since it will always be the same (ie. the URL of the front-controller).
Rewriting the requested URL in this way will not work with WordPress, Joomla, Drupal, etc. etc.
Only if your CMS provides a mechanism for explicitly overriding the requested URL (eg. with a URL parameter perhaps) can you do this at the server level, otherwise, you need to configure this route in the CMS itself. (ie. Preferably changing the URL/route from /root
to /
, rather than adding this as an "alias", which could potentially cause duplicate content issues.)