301 url redirect question

eNzim

Senior Member
Jr. VIP
Joined
Feb 12, 2015
Messages
870
Reaction score
506
I'm not particularly a techie type, so I apologize if this is a stupid question.

So, I'm having a url redirection problem: I've recently purchased a domain, let's name it donordomain.com (obviously made up names) and 301 redirected it to my other site: recipientdomain.com. I used hostgator cpanel for that. Not wildcard redirect, because I wanted all pages to point to recipientdomain.com home page.

Unfortunately the 301 doesn't work properly with subpages like donordomain.com/12345 because I get a 404 page and it doesn't redirect. How is it possible to resolve this issue?

Found some .htacces codes on Stackoverflow, but as I mentioned befored I'm not a techie so, I have no idea what works

Altough, there is something I could do, but I don't think this is the proper way to do it. So, I could wildcard redirect the domain and then use a 404 to 301 plugin on recipientdomain.com, but that would be a double 301, which would further weaken the power of links pointing to donordomain.com I think .

I'd really appreciate some help because hostgator live chat reply was this:

- That would require extensive coding, which is something that we are not able to assist with

So, yeah, anyway thank you in advance!
 
This is the code you want on your donordomain.com's root directory's .htaccess to redirect all the subpages of donordomain.com to the recipient site's root directory.

Code:
RewriteEngine On
RewriteRule ^(.*)$ http://recipientdomain.com/ [R=301]

P.S Make sure to remove the host's redirect ie., the one you set up inside hostgator's cPanel before adding this code to .htaccess.
 
Thank you @SpoonFeeder it works like a charm!

tenor.gif
 
Back
Top