Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder howie2009's Avatar
    Join Date
    May 2009
    Location
    Ireland
    Posts
    206
    Thanks
    37
    Thanked 0 Times in 0 Posts

    redirect to a directory

    Hi,
    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?
    THANKS

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    If Apache, see 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.
    Are you a Help Vampire?

  • Users who have thanked tomws for this post:

    howie2009 (07-08-2009)

  • #3
    Regular Coder howie2009's Avatar
    Join Date
    May 2009
    Location
    Ireland
    Posts
    206
    Thanks
    37
    Thanked 0 Times in 0 Posts
    Hi,
    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?
    Thanks

  • #4
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    No idea on that. The host should provide some documentation on those functions, though.
    Are you a Help Vampire?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •