View Full Version : redirect to a directory

07-08-2009, 02:17 PM
I built a new website into a directory called site eg www.xyz.com/site to replace the old site which is in eg www.xyz.com. I want to keep the files in the root just in case.
I dont want users to access the files in the root so need a redirect that redirects www.xyz.com/"anyfile" to www.xyz.com/site/index.html
How can i do this?

07-08-2009, 03:07 PM
If Apache, see RedirectMatch (http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirectmatch) in the manual. You may prefer URL rewriting so that your users never see the extraneous /site/ in the middle of the domain name and the new files/directories.

07-08-2009, 03:49 PM
Its a windows hosting plan using H-Sphere as the control panel.
There is a redirect and a directory redirect section but cant seem to it thru this. I expect id need special code in the htaccess file?

07-08-2009, 05:51 PM
No idea on that. The host should provide some documentation on those functions, though.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum