Inside the .htaccess file
RewriteEngine On RewriteCond %{REQUEST_URI} !^/newdirectory/CMS/ RewriteRule ^(.*)$ /newdirectory/CMS/$1
This will overwrite, so accessing http://www.server.com/CMS/index.html will actually serve the contents of http://www.server.com/newdirectory/CMS/index.html
Note. This solution assumes that the CMS is the only one served for this domain.
If this domain serves more than CMS (and only CMS needs to be redirected), then it might be better:
RewriteEngine On RewriteCond %{REQUEST_URI} ^/CMS/ RewriteRule ^(.*)$ /newdirectory/$1
Luke stevenson
source share