How Do I Redirect to a new domain for this...

by James-
3 replies
  • SEO
  • |
Hey guys,

I can't find the info for this anywhere! Do any of you guys understand .htaccess redirects enough to know how to fix this:

I am looking to 301 my old domain to a new domain WITHOUT redirecting the old domain's homepage.

I need olddomain.com/page-1 to 301 to newdomain.com/page-1
so, everything mimicked from olddomain.com to newdomain.com EXCEPT I don't want the root olddomain.com forwarding to the root newdomain.com

hope I haven't made that sound over complicated. How is this done please!?
#domain #redirect
  • Profile picture of the author James-
    Managed to resolve this myself in the end. For anyone else interested here is the code:

    RewriteEngine on

    RewriteCond %{REQUEST_URI} !^/$
    RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L]
    Signature

    2 nuts walked into a bar, 1 was assaulted! :p

    {{ DiscussionBoard.errors[8582623].message }}
  • Profile picture of the author HeadStartSEO
    Thanks for sharing. Bookmarked!
    {{ DiscussionBoard.errors[8582765].message }}
  • Profile picture of the author Najgel
    Glad you made it, I'm aswell always troubeling with the redirections. For most cases I use a wordpress plugin to get over this damn module rewriters
    {{ DiscussionBoard.errors[8585652].message }}

Trending Topics