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

Need Quick Help 301 Redirection htaccess

Discussion in 'General Programming Chat' started by VIC SEO, Jul 20, 2014.

  1. VIC SEO

    VIC SEO Elite Member

    Joined:
    Feb 19, 2010
    Messages:
    2,156
    Likes Received:
    363
    Gender:
    Male
    Occupation:
    SEO Specialist
    Location:
    iSynergyMedia
    Home Page:
    i need your quick help basically i want to redirect my old domain to new domain but the main page of old domain should go to subpage of new domain and rest of page should work on main domain...

    Example :www.old-domain.co.uk --> new-domain.co.uk/subpage

    old-domain.co.uk/services-->new-domain.co.uk/servcies
     
  2. divok

    divok Senior Member

    Joined:
    Jul 21, 2010
    Messages:
    1,015
    Likes Received:
    634
    Location:
    http://twitter.com/divok
    it is confusing , what I understand is that you want to redirect example.com -> newexam.com/subdirec
    and rest of the pages like example.com/a , example.com/b etc should redirect to newexam.com/a newexam.com/b etc ?
    is that correct ?
    Code:
    # 301 Redirect 1
    RewriteCond %{QUERY_STRING}  ^$
    RewriteRule ^example\.com$ newexam.com/sub? [R=301,NE,NC,L]
    
    # 301 Redirect 2
    RewriteCond %{QUERY_STRING}  ^$
    RewriteRule ^example\.com/(.+)$ newexam.com? [R=301,NE,NC,L]
    
    
     
  3. VIC SEO

    VIC SEO Elite Member

    Joined:
    Feb 19, 2010
    Messages:
    2,156
    Likes Received:
    363
    Gender:
    Male
    Occupation:
    SEO Specialist
    Location:
    iSynergyMedia
    Home Page:
    Thank you very much you understand correctly.I did not try the below code because i have hired PHP developer and he done the job in PHP.

    I really appreciate your help..i hope this will help other people.Once again thank you very much.