WordPress.org

Ready to get started?Download WordPress

Forums

Moving domain - Intelligent forwarding script/code help (2 posts)

  1. iamthechosenone
    Member
    Posted 6 years ago #

    Hello, I have searched everywhere to see if there was anywhere that had the script/code that I need, but I couldnt find anything.
    I have a wordpress blog on domain1.com/blog/ but I have decided to move it to its own domain, domain2.com

    Now, I could just do a simple forwarding script so that all visitors were sent over to domain2.com, but over 90% of my users come from search engines, so after searching for what they want and clicking on the link to my site, they would not want to have to search again on domain2.com.

    Both blogs will have identical settings and layouts, so I need some kind of script/code that I can put on domain1.com to detect the address that the user visited and then edit it and forward them. For example, if a user visits domain1.com/blog/blahblah/ then they would need to be forwarded to domain2.com/blahblah/

    Alternatively there might be a way to take the last part of the address and search. So a user visiting domain1.com/blog/blahblah/ would be forwarded to domain2.com/?s=blahblah

    If anyone can help or provide a script I would be very very grateful and would be happy to offer you free advertising on my blog.

    Thanks in advance

  2. scribblerguy
    Member
    Posted 6 years ago #

    Just use server-based redirection. For Apache, the mod_alias documentation covers that. Also, see this Redirection Guide.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.