b2bmike

Registered
Sep 20, 2009
1
0
51
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
 
Last edited by a moderator:

thewebhosting

Well-Known Member
May 9, 2008
1,199
1
68
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.
 

InstaCarma_Tech

Well-Known Member
Apr 22, 2009
227
1
68
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]