1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Best way to redirect from domain to sub page?

Discussion in 'White Hat SEO' started by brodel34, Aug 26, 2015.

  1. brodel34

    brodel34 Regular Member

    Joined:
    May 6, 2013
    Messages:
    246
    Likes Received:
    17
    If I want to keep mysite.com/thisdirectory as my main site for seo, How should I redirect from the main domain mysite.com? And how does that work with backlinking? Should I focus on backlinking to mysite.com even though it redirects to mysite.com/thisdirectory? How would that read on the search engine? Meaning which site url would show up in the results. Am I making sense? Thanks in advance
     
  2. metafser

    metafser Regular Member

    Joined:
    Jul 20, 2014
    Messages:
    449
    Likes Received:
    268
    Gender:
    Male
    Occupation:
    Digital Marketing Influencer
    Home Page:
    Redirect root directory to sub-directory by using .htaccess file. Use this code for redirecting you root to sub
    Code:
    RewriteEngine onRewriteBase /
    
    
    RewriteCond %{REQUEST_URI} !^/blog/
    
    
    # Rewrites all URLS [Replace "domain" with the actual domain, without the TLD (.com, .net, .biz, etc)]
    RewriteCond %{HTTP_HOST} ^(www\.)?domain\.
    
    
    # Rewrite all those to insert /folder
    RewriteRule ^(.*)$ /blog/$1 [L]
    
    If you want to do it for subdomin, then use this code:
    Code:
    [FONT=Verdana]RewriteEngine on[/FONT]RewriteCond %{HTTP_HOST} domain\.com [NC]
    RewriteCond %{REQUEST_URI} ^/$
    RewriteRule ^(.*)$ /blog/$1 [L]
    
    You will create backlinks for your sub-directory. If your root directory gets any backlink, root directory will pass juice to your sub-directory. So don't worry about it.

    Obviously search engine shows your sub-directory or sub-domain. Whatever you do.
     
    • Thanks Thanks x 1
  3. brodel34

    brodel34 Regular Member

    Joined:
    May 6, 2013
    Messages:
    246
    Likes Received:
    17
    Edit: perfect. Got it thanks
     
    Last edited: Aug 27, 2015
  4. SEO FOX

    SEO FOX Jr. VIP Jr. VIP

    Joined:
    Apr 27, 2015
    Messages:
    3,223
    Likes Received:
    659
    Gender:
    Male
    Location:
    Infront Of U!!
    Home Page:
    Thanks mate for the useful answer.