The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Redirect Issues

Discussion in 'General Discussion' started by Izzibeth, Apr 27, 2009.

  1. Izzibeth

    Izzibeth Registered

    Joined:
    Apr 27, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hello

    I have been searching the forums for a problem similar to mine and haven't quite found it so here goes:

    I am unable to successfully redirect my home directory to any other directory on my site. I went into the Redirect area and chose either Permanent or Temporary for the first option (it didn't matter). I then chose the home directory (http://(www).example.com/) and asked it to direct to another section of my site (http://www.example.com/index). It set it up successfully. However, when I typed http://www.example.com into my browser I got the Redirect Loop error. I tried this multiple times with no success.

    Finally, I changed the htaccess.txt file to .htaccess. This seemed to fix things... except it didn't.

    Now my problem is that no matter what I type in, it will only redirect to the http://www.example.com/index site. For example... if I type in http://www.example.com/home or http://www.example.com/forum it will only direct me to http://www.example.com/index.

    This would not be a huge problem except that all image files on my website no longer work as the URLS (e.g. http://www.example.com/image/image1.jpg) are no longer working because EVERYTHING is being directed to http://www.example.com/index

    I hope that all makes sense......

    Any help would be appreciated because this is extremely frustrating and I can't seem to figure out what the problem is at all.

    Thanks!
     
  2. thobarn

    thobarn Well-Known Member

    Joined:
    Apr 25, 2008
    Messages:
    153
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    sanctum sanctorum
    If I understand you right, you want your root directory to point to a directory within root directory? E.g.

    http://www.example.com/index/[files_and_folders] instead of http://www.example.com/[files_and_folders]

    If that is the case, enter following into .htaccess (NOT .htaccess.txt)

    Code:
    <IfModule rewrite_module>
    	RewriteEngine on
    	RewriteRule   ^/$  /index/  [R]	
    </IfModule>
    alternatively use RedirectMatch directive

    Code:
    RedirectMatch ^/$ http://example.com/index/
    which does not require mod_rewrite.

    Obviously you will need to move everything under index directory.
     
Loading...

Share This Page