Redirecting old domain urls from old host, to new domain urls with new host, but individual pages are named differently - redirect

Both domains were purchased through network solutions. The old host won't exist anymore, so I can't rely on them to serve the htaccess redirects. I can point the nameservers to the new host, but then what? None of my redirect code seems to be working. Any help is much appreciated.
Ex:
olddomain.com > newdomain.com
olddomain.com/hello > newdomain.com/goodbye
olddomain.com/123 > newdomain.com/456

You probably want to do something similar to this: .htaccess RewriteRule: two domains using same server and directory
Having that said, in most cases a static html page saying "This page has moved. Link to new page: ..." is preferred above .htaccess redirects, because people browsing your webpage will then update their bookmarks to the new URL, which they will not otherwise.

Related

Redirect Domain to Subdomain using Cloudflare

I'm using a marketing automation platform to build landing pages and those landing pages URLS are automatically published with a subdomain structure, like:
https://subdomain.example.com/mylandingpage
I want to redirect all www and non www visits to the main domain to this landing page that I created, in other words I wish the https://example.com and https://www.example.comto be redirected to https://subdomain.example.com/mylandingpage
Since I'm only using this platform and did not subscribe to any hosting, I'm trying to use Cloudflare to make all this redirects.
I saw a tutorial and this guy said that A entries in my DNS shouldn't be blank and recommended setting them to a reserved IP address, so I set both A entries to 192.0.2.0.
Ok, then I went to page rules and set a 301 redirect to *example.com to be redirected to https://subdomain.example.com/mylandingpage
I can see that when I visit my main domain it's redirected to the subdomain correctly, but the page doesn't load, and I get a too many redirections error. I believe that I made something wrong and it's redirecting everything to the subdomain, even the subdomain is redirecting to itself, even having a page path /mylandingpage after the hostname.
Did I make myself clear? Is there any other way to do what I want?
In Cloudflare page rules instead of *.example.com, please use exact domain match.
URL path we can use wildcard.
www.example.com/* - https://subdomain.example.com/mylandingpage
example.com/* - https://subdomain.example.com/mylandingpage

Domain Forwarding for specific URLs

I have a domain with GoDaddy called "livingmiracles.org". For years I had this domain forwarding to my livingmiraclescenter.org Joomla website. Recently, I discovered that the way the livingmiracles.org domain now forwards to our livingmiraclescenter.org site has changed and has left me with broken links on almost all of the over 60 websites I manage.
This is what used to happen:
Any URL of the livingmiraclescenter.org website would be able to be displayed with the livingmiracles.org domain instead. For example, the following URLs were interchangeable:
livingmiraclescenter.org/david-hoffmeister.html and
livingmiracles.org/david-hoffmeister.html
livingmiraclescenter.org/contact.html and
livingmiracles.org/contact.html
livingmiraclescenter.org/spiri-tv.html and
livingmiracles.org/spiri-tv.html
Also, variations of the above without ".html" would work.
Now, none of this works anymore. For the "livingmiracles.org/" links above, now, either the livingmiraclescenter.org home page pulls up or I get a GoDaddy error page.
I called GoDaddy and they confirmed a change in the way they handle domain forwarding now.
Can anyone suggest a simple/smart way—perhaps a RewriteRule or something like that—that I can set up somewhere (where?) to handle those specific page redirects? Basically, I want all my livingmiraclescenter.org links to be interchangeable with livingmiracles.org links like I wrote above in those examples.
Thank you so much!
Jutta

Redirect with cname to subdomain while retaining cname web address

i have this problem where i have a subdomain sub.host.com and a new domain www.new.com. I want to redirect www.new.com to sub.host.com without showing the browser that the url had changed. The content is in sub.host.com but i want that even after the page has fully loaded, it is still showing www.new.com
This means also that when i go to sub.host.com/function, it should also appear as www.new.com/function
The reason is the actual subdomain looks ugly and contains numerics. Is this possible to do? Ive tried searching but all that comes up are only about how to go about creating cname records and none about keeping it intact after redirecting. Thanks
A (reverse proxy) server like Nginx, which is very light-weight, features the url-rewrite rules that you need. IIS7 has also a good url-rewrite engine.

Redirect a domain from Joomla 1.5.11 to Wordpress on different domain

I have a question, I built a website for a client with a new domain (www.domain1.com) and new hosting. They have an old website with a different domain (www.domain2.com). The client requests that if someone clicks on www.domain2.com, that would take them to www.domain1.com. I built the website using WordPress, and the old website is built using Joomla 1.5.11 which doesn't have the option to use redirect under the Components option. I don't have any experience in Joomla 1.5.11 which is pretty old. Thanks in advance for looking into this for me.
Do you mean you want the domain to be redirected?
You can set up a 301 permanent wildcard redirect on your domain2.com to point to domain1.com.
Setting this up will also depend on the type of host you're using.
Also, you can set up an index.php file at the root of domain2.com to redirect:
<?php
header("Location: domain1.com");
?>
The problem with the above script is that you won't be able to do a wildcard redirect! But it can work with any Joomla! link, as Joomla's entrypoint is always set to index.php.
If none of the above is feasible for you, try adding more details about what you actually want to do.

Web Forwarding or CNAME Solution - Which is Correct?

I have recently done some website work for a charity. The site I have built has been hosted on my own domain, in a directory. The site's address is www.mydomain.com/newsite/
The organisation has purchased their own URL and would like that URL to point to my hosted site such that the user goes to www.Charity.org and is shown the content from www.mydomain.com/newsite/
I've partially achieved what I wanted to do by using a 302 redirect and a frame, which I set up through the control panel for www.Charity.org, however this has the disadvantage of never displaying anything other than www.Charity.org in the address bar.
Essentially I would like to "mask" the mydomain URL with the charity one, so that the folder structure is still visible to the end user. If they go to www.charity.org/events then that's what they should see in their browser, but the content should map to www.mydomain.com/newsite/events
I have explored CNAME and A NAME solutions but neither of these seem to allow me to point to a directory.
Is this even possible?
The solution is A NAME record.
In DNS zone file of charity.org, create A NAME record of www (& #) to point to your server IP (where the website live).
On server, you'll have to set DocumentRoot for www.Charity.org host. DocumentRoot must be the directory in which default webpage (index.htm, index.php etc) live. Done!
Provide your web server details if you need further help about setting DocumentRoot.
This can also be done with CNAME, but it'll require more complex server side configurations. And, I don't recommend to use masked web forwarding because its not SEO friendly and universally compatible.