This does redirect eeight.com to gagcartoons.com, but it doesn’t redirect eeight.com/cartoons/ to gagcartoons.com/cartoons/ (gives 404 error). If it makes any difference, “/cartoons/” isn’t an actual folder, but just a mod_rewrite. How can I make it redirect all the subfolders to the new domain?
PS - I have searched for and tried several methods (like this one), but none seem to work. Some even gave a “Redirect Loop” error.
RewriteEngine on
RewriteCond %{HTTP_HOST} eeight\\.com$ [NC]
RewriteRule .? http://www.gagcartoons.com%{REQUEST_URI} [R=301,L]
Aside from looking for the OLD domain to redirect to the new domain, I’ve used the {REQUEST_URI} variable rather than capture it again with the :kaioken: EVERYTHING :kaioken: atom
AND
replaced the No Case flag with the Last flag in the redirection. Why bother using it there with . matched EVERYTHING … AND you need to end the mod_rewrite block statement?
[L] is the Last flag. That’s the same thing as ; and/or } in typical programming languages. Unfortunately, mod_rewrite does not require it in order to function (it ANDs that block with the following block statement without the Last flag).
If that’s not working for you, you need to show ALL your .htaccess file as there is no reason for it not to work with what is shown.
The lesson obviously didn’t take! USE the Last flag to prevent everything being ANDed!
Without seeing your test URI, no telling what will happen (other than NOTHING) past the first redirection.
Moreover, the / in the redirections CAN (not necessarily will) cause problems as that can be interpreted by Apache as dealing with the physical root rather than DocumentRoot.
The thing I love/hate about programming/coding is that, some times, the biggest headaches are caused by the smallest mistakes.
I went into my cPanel and changed the old domain (eeight.com) from an “Add-on Domain” to a “Parked Domain.” Now the code you gave me works like a charm. Thanks very much for your continued help!