Pointing domain at seperate sub-domain & domain

I have a domain residing with one organisation for managing DNS and a wordpress site built as a sub-domain of another site of mine.

I set up web forwarding, expecting the domain to be reflected in the address bar for site visitors, but the sub-domain is showing instead.

Read More

i.e. www.domain1.com should forward to subdomain.domain2.com and show www.domain1.com in the address bar. Meanwhile, my www.domain2.com should still render the other wordpress site I have there.

Am I right in thinking I need to do this through my htaccess file? If so, can anyone advise on the syntax I need to use to do this? I can currently only find information on mapping a sub-domain to the www of the same domain.

Thanks in advance 🙂

Related posts

Leave a Reply

2 comments

  1. This comes down to the provider’s definition of “web forwarding”, which is a vague marketing term. It sounds like they’re just doing a straight redirection unfortunately, which no amount of playing with .htaccess files can fix: you simply cannot make a website tell the browser to stick another domain name in its address bar.

    What I’d suggest is talking to them and see if they can do a CNAME for www.domain1.com to subdomain.domain2.com, or switch to it using the same IP address instead. You will then need to set up your WordPress install to respond to “www.domain1.com” requests.

  2. do you have control panel for your domains?

    Im using direct admin and they call it “domain pointers” – I believe it does exactly what you need.

    You need to create alias for your subdomain.domain2.com which will point (not forward, if you forward it also url in browsers address bar will be changed) http://www.domain1.com to the subdomain.domain2.com without url change.

    If you are not using any control panel, you need to create alias manually by adding same dns for your http://www.domain1.com (no matter A or CNAME) as it is for subdomain.domain2.com AND in server configuration set response for http://www.domain1.com (ie. apache servername and serveralias, in iis binding)

    I dont think .htaccess is a good idea for achieving what you described.