Need Quick Help 301 Redirection htaccess

VIC SEO

BANNED
Joined
Feb 19, 2010
Messages
2,169
Reaction score
314
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 :http://www.old-domain.co.uk --> new-domain.co.uk/subpage

old-domain.co.uk/services-->new-domain.co.uk/servcies
 
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]
 
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.

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]
 
Back
Top