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.

Not really redirecting

Discussion in 'General Discussion' started by b2bmike, Sep 24, 2009.

  1. b2bmike

    b2bmike Registered

    Joined:
    Sep 20, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I'm a newbie to cpanel so please bare with my question. What I'm trying to do is actually, yes in one way redirecting my subdirectory (LEN) to the main URL but I want to make LEN my domain name.

    So I want lebenvironment.com/LEN/ to be my main domain lebenvironment.com and what ever is in old lebenvironment.com will disappear.

    Your advice is appreciated.
    Merci
    Moi
     
    #1 b2bmike, Sep 24, 2009
    Last edited by a moderator: Sep 24, 2009
  2. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    You will have to write the rewrite rule in your .htaccess file to redirect your subdomain to your main domain.

    Regarding changing the domain name you will have to contact your hosting service to change the domain name.
     
  3. InstaCarma_Tech

    InstaCarma_Tech Well-Known Member

    Joined:
    Apr 22, 2009
    Messages:
    228
    Likes Received:
    1
    Trophy Points:
    18
    You can use the following code in your .htaccess for re-directing the main domain to the sub-domain
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^present site.com/$ [NC,OR]
    RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^www.present site.com/$ [NC]
    RewriteRule ^(.*)$ http://www.present site.com/sub-folder/$1 [r=301,nc]
     
Loading...

Share This Page