Pointing domain at seperate sub-domain & domain - wordpress

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.
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 :-)

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.

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) 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 www.domain1.com (no matter A or CNAME) as it is for subdomain.domain2.com AND in server configuration set response for www.domain1.com (ie. apache servername and serveralias, in iis binding)
I dont think .htaccess is a good idea for achieving what you described.

Related

Add NGINX redirect to specific URL

So I have a nice wordpress site, which has a translation. for example, this translation is located at https://example1.com?lang=fi
I also have another domain. https://example2.fi
How do I get the other domain to redirect to the translated url? and how do I make sure the https://www.example2.fi goes as well?
My provider gives me access to add custom nginx configs.
Alternately, is it better to do these kind of redirects in wordpress?
I have modified the dns already to point example2.fi to the correct ip.

Its possible to set a domain easily for a internal page of a CMS like WP or Joomla on a LAMP environment?

Lets say for example that I have a CMS installed on a domain: mycms.com
With Joomla or Wordpress on a LAMP environment (Linux, Apache, Mysql, PHP), lets say that it uses Cpanel.
And I have a page like for example mycms.com/mycategory wich links for different internal post/articles.
mycms.com/mycategory/post-1
mycms.com/mycategory/post-2
Now I have another domain: myotherdomain.com
And I want to setup this domain for that page (mycms.com/mycategory) In a way that every internal page also responds to that, example:
myotherdomain.com/post-1
myotherdomain.com/post-2
Notice, its not a simple redirect using PHP header() or JS, I want that myotherdomain.com to stay visible on browser address.
My question, this is possible? And its possible to do this without a dedicated server with SSH access? How I may do this? Editing my .htaccess?
Yes, you can. As you say, it's not a simple redirect, but it's a Proxy redirect. You can solve such problems at any preceding reverse proxy or immediately in Apache with mod_rewrite's proxy flag (it is [P]).
If you don't need any special pattern matching, you can even use PorxyPass:
ProxyPass "/post/" "https://mycms.com/mycategory/post/"

Point DNS to Squarespace Except for a Specific Subdirectory

My client is moving their site to SquareSpace, but wants to keep the blog portion hosted in WordPress. I'm not sure what their current hosting plan is, but is it generally possible to point "example.com" to SquareSpace, and have "example.com/blog" still exist as a WordPress site?
Thank you!
This can't be done solely through DNS as DNS is ignorant of the path and works only with the domain name. The only way to do this through DNS would be to move the blog from example.com/blog to blog.example.com, then the website can be located on one service at example.com and the blog can still be located on wordpress at blog.example.com.

WordPress multisite network with non-wp site at domain

I want to set up a multisite network using subdomains under a domain that is used for a non-wp site.
so, for example, we want our domains to look like:
blog1.mysite.com
blog2.mysite.com
but mysite.com points to our main site that is not built with WordPress and is not part of this network.
I'm not sure what to do here since the main domain, site.com in this case, typically points to the root blog on the multisite network.
I suspect this is common and there is a simple solution but I'm not sure where to start.
Update (unresolved) :
I've had a little bit of luck working on this locally but I'm still not out of the water...
my dilemma… I need to set up multisite with subdomains under a domain that is not part of the network? So basically, we have our main site: mainsite.com
and we want to set up a network with subdomains like site1.mainsite.com and site2.mainsite.com.
mainsite.com, however is not a WordPress site and is not part of the network. so If I set the network up under multisite.mainsite.com, then new sites subdomains are created with that as the subdomain like: site1.multisite.mainsite.com
but if I set the current site to mainsite.com, then all of the network admin links break because they point to our main non-wp site.
So, here's what I've done, which kinda works (I'm doing everything locally with my hosts file so I won't know for sure until I get it on a dev box) ...
First I pointed mainsite.com to my local ip in my hosts file and set the network up under mainsite.com
Next I successfully created two sites. multisite.mainsite.com and site1.mainsite.com, through the network admin panel
Then, I changed the 'current site' in wp-config.php from mainsite.com to multisite.mainsite.com and I removed mainsite.com from my hosts file.
Now, I can go to mainsite.com and land on our primary website; I can go to site1.mainsite.com and land on the wordpress site on the network; and I can access the network-admin-section under multisite.mainsite.com
The problem is, since the current site is multisite.mainsite.com, if I try to add a new site to the network, the domain will be site3.multisite.mainsite.com instead of the intended site3.mainsite.com
So I still haven't found the correct solution here but this might help explain my problem a little better
Ok, I figured it out... I didn't realize previously that you can manually change the site url in the site edit screen. Here's a write up with more details: http://georgespake.com/create-a-multisite-network-using-sub-domains-under-an-existing-domain/

Apache, Domain, Wordpress, DynDNS Setup Issue Redirection

Hopefully someone can help because I'm hitting a brick wall here! :)
I have setup an apache web server at home and I have installed wordpress.
I also have my own domain and a dyndns account, I have repointed a dyndns record to my hostname on a different port.
When I navigate to my website it works fine however if I don't enable cloaking on dyndns it shows my hostname. I don't really want this as I want it to display only my domain name.
If I enable cloaking on dyndns to use my domain url wordpress sort of works however if I click on Log in to get to my control panel I get a blank page as its trying to navigate to my hostname:port
Please could someone point me in the right direction? I'm sure their must be a way to do this!
Thanks in advance
Dan
I use Dyn to manage my Domain and DNS, but I had never used their WebHop feature before. I checked it out and, unfortunately, I don't think it will produce a completely transparent proxy for WordPress as you had hoped.
The problem is that "When Cloaking is enabled on a WebHop, frames are used to mask the address and title bars." (ref: here). If you define a cloaked WebHop for blog.example.com that redirects to http://yourhome.dyndns.org:8080/wordpress/ then the page that appears "belongs" to blog.example.com but displays content from the actual host inside a frame
<frame src="http://yourhome.dyndns.org:8080/wordpress/" name="redir_frame" frameborder="0"
scrolling="auto" noresize="noresize" marginheight="0" marginwidth="0"/>
The frames are messing you up when you click on a link. In your case you get a blank page, but under IE9 I see
If in your WordPress settings you have "WordPress Address (URL)" set to http://yourhome.dyndns.org:8080/wordpress/ then clicking the "Open this content in a new window" link will work, but you've lost your cloaking. If you try to preserve the cloaking by changing the "WordPress Address (URL)" to http://blog.example.com then your WordPress site won't work correctly either.
So, I think you'll have to choose between:
Using a WebHop and exposing your actual hostname/port (at which point cloaking becomes something of a moot point), or
Looking into setting up a reverse proxy on another server to redirect traffic to your "home site" and map the links back to the proxy (for complete transparency).

Resources