Show another-example.com as example.com/another in browser (2 domains/WordPress installations on 1 domain) - wordpress

the company I work for currently owns two domains, e.g.:
example.com
another-example.com
I manage the WordPress installations, which run on those domains (two distinct installations with separate themes, plugins, webspaces, databases, ftp, etc.), in my free time as they always come up with challenging requirements which helps me improve my skills (and because the company is really nice to me in general).
They've asked me if it was possible to redirect another-example.com to example.com/another and display everything from the second WordPress installation under that URL.
For example the main page of another-example.com should be displayed under example.com/another, the subpage another-example.com/about-us should be displayed under example.com/another/about-us and so on.
All the WordPress pages of example.com should continue to work as they are now ("another" would in reality a word which would never be used as subpage of the main domain, so that won't ever be an issue). Basically they just want the browser to display example.com/another instead of another-example.com for "tracking, SEO and usability" (I didn't question that... 😅).
I just wanted to know whether this is possible or not.
One idea that came to my mind was to setup example.com as WordPress multisite installation and run another-example.com as subsite of that multisite on /another. Though I'm not very familiar with multisite, I blieve this is how it could work and it surely isn't to hard to migrate a normal WordPress installation to become a subsite of a multisite. I'm familiar with databases so worst case is I have to do some manual labor if it isn't already possible out of the box by using some backup plugin or so.
But I was thinking that maybe it is possible by changing some settings in the webservers. It's just that Apache HTTP servers aren't really my world at all and even though I tried to understand the configs multiple times over the last decade, I never did and I have no clue how that would work (if it is possible at all).
So my question is: Is it possible to achieve this by configuring the webserver and if so, can you also provide a working config we could use?
I'm also open to better suggestions than the two I thought about. Maybe theres something easier and better to achieve this goal.
Thanks in advance
Jan

Related

Howto setup multiple TLDs for multisite in Wordpress

I tried nearly everything for now 2 days but i can´t figure out what is the problem.
we have three websites, which all now get a small shop. so we decided to use wordpress and woocommerce. We also decided to use multisite for easier management.
The sites shall run on 3 different TLD as subsite.
No matter what i do, no matter which link i follow and which tutorials i follow, i can´t get it to run. The domains are all assigned as subdomains, new.site1.com, new.site2.com and new.site3.com and also point correctly to the directory.
But i can´t login to a subsite, execpting the main site. Everytime i want to switch to a subsite which is not the main site, i will get redirected back. This also happens in the frontend.
It also doesn't matter if the installation is clean or not. I also tried it out with no plugins activated. Like already said, i followed every guide.
The domains are btw. "just" domain alias defined in plesk. Maybe that is a problem for wordpress? Is that possible? If yes, i need to tell my boss "buy new domains".
I wonder if there is someone out there who has the same problem like me right now.
The next step would be to use 3 instances again, but that´s not really what i want. So i hope anyone can help me, thanks!

Project Setup for Multisite development

I am about to develop two websites using wordpress with its multisite functionality. So www.domain1.com and www.domain2.com should point to the same wordpress installation.
The problem I have is that the domains are in productive use, so I cannot make them point somewhere else until development is not finished. I also do not have (and do not want to buy) two unused domains to create the develop setup, so what I would like to know is:
Can I setup subdomains for development and change it into »real« domains later on?
What I would like to know is how to setup the project so that after development is finished, deploying is as painless as possible. The project setup should be close the »real world scenario« it is meant for as possible and I am interested in any kind of hints, advises, links and stuff which guides me setting up the projects.
Which are the pitfalls, where are the »dangerous« parts?
Greetings...
I'd suggest the following route:
Install the Multisite with a sub-domain set-up in a third domain that will be the Main Blog (example.com). In your host, you'll need Wildcard subdomains enabled. Otherwise, each sub-domain has to be manually created. With the wildcard, creating a new site is a matter of clicking Add site.
Then, in /wp-admin/network/sites.php, add two sites: domain1.example.com and domain2.example.com. And develop until they are ready.
You'll need the plugin WordPress MU Domain Mapping to map Top Level Domains to the sub-sites/sub-domains. With it, domain1.example.com will be a fully working domain1.com.
After all this is in place, is just a matter of changing the NameServers to point to the Multisite addresses.
Well, it seems simple but Multisite is not for the faint of the heart. But, one of WordPress.org wizards, Mika Epstein, aka Ipstenu, has two great eBooks that cover lots of ground. Please, check the following Answers in WordPress StackExchange where I cite them.
An interesting case study document.
Plugins of interest:
BackupBuddy: paid solution, although it's considered Beta, exporting and importing sites out and in the networks works ok.
Add Clone Sites for WPMU (batch), in the Repository, although hasn't been updated in a while, still works fine, doesn't exports/imports, but useful for duplicating sites inside the network.

Externally managed htaccess-protected members area in WordPress with url rewriting?

I am considering converting a client project from a large number of hand-built web pages to a WordPress install. However, this client has a free area (site.com/) and a members area (site.com/members/). The members area is standard Apache .htaccess / htpasswd authentication. The authentication is handled by legacy billing software which we don't want to change at this time.
One thought is to put up two separate WordPress installs (or perhaps a MultiSite install?). One install sits on the domain root and the other sits at /members/. Thus neither install has to know anything about being password-protected. So long as the outer install cannot generate a url which includes /members/, I'm pretty sure the url-rewrite engines won't interfere with each other.
Another thought is to try to do everything in a single install, and expect the server to force authentication on any url that maps to /members/. But intuitively it feels like I'd have to go to a custom taxonomy to get "free area" category hierarchies separate from "member area" hierarchies.
Any WordPress plugins which I've found, and any related discussions, assume that the members are managed via WordPress. That's the issue: the members area is simply protected via old-school htaccess authentication.
I'm not sure that the WordPress url-rewrite mechanism would trigger the authentication part as intended, given that WordPress is sitting at the domain root, outside the members area.
On the other hand, running it as two WordPress installs, one inside the other, might be just what I need. Anyone have perspective on this? Anyone know of problems running WordPress "inside" WordPress as described?
Yes. Given my restrictions, a double install is the most reasonable solution.

New wordpress site on same server without touching old site, but take over the URL

The problem is as follows: A new WordPress site will be installed on the same Nginx server as the current one. The current one (based on Joomla) has some complex database functionalities which will be reused. I.e. the new site will retrieve a section of it's content from the old site, with PHPs file_get_contents() or HTTPRequests.
I have no knowledge about the current site, so I'm afraid that when I try to give it a new address, I will break things. This is what this question is based on, so if I'm already wrong here, please say so.
Now my idea is to just install a wordpress site with the wordpress address configurations set to the domainname, but without setting the servers pointers for that domainname to the new site. Now I will add a rewrite rule to the current site, which rewrites all incoming traffic to the new site (directory on the server), except when the request comes from localhost, so the new site itself CAN get to the current site.
I'm relatively new to this kind of things, thinking of my proposed solution raises questions too. My question is whether my solution will work, and / or is there a better way of doing this? Unfortunately I can't just go test it.
Thanks
In theory that approach will work but it sounds rather fragile. Rewrite rules can be very tricky to get right even if you know what you're doing, so the "unless it's coming from localhost" may throw you for a loop.
You say you're not sure the existing site will break if you move it to a new domain or subdomain, but there's really no harm in trying, since you can leave the existing domain intact while you try.
So if the existing site is at example.com, try setting up a second virtual host that serves it from internal.example.com. If it works (or at least delivers the content your'e trying to scrape), go ahead & set up the Wordpress site and get the content using the "internal" URL.
The real problem though is that now you're stuck maintaining both a Joomla site and a Wordpress site. What is the complex database functionality you're trying to reuse? Is it at all possible to migrate that into a standalone PHP block that you can then call from Wordpress?

Drupal installation and domain naming strategy?

I have a my main site, called "mysite.com" (for arguments sake). On this site, you will find my blog and everything I do. But I am starting another site that I want to run on my domain. However:
The other site must have it's down domain name: newsite.com
If people go to mysite.com/newsite it must redirec to newsite.com
If people go to newsite.com, it must show the content of what they would see if they had gone to mysite.com/newsite in the past
So basically, I want a "page" or actually a whole section ( mysite.com/newsite/* ) to appear as newsite.com in the browser.
Why?
I want both sites to run off one drupal installation
I want both sites to look basically the same
However, keep in mind that I don't want to use a multi-drupal solution. i.e. a module that allows for more than one copy of drupal to run off 1 installation.
http://drupal.org/project/domain allows you to configure various things based on the domain, for example accessible nodes.
You can probably do the redirect with a Rewrite Rule, outside of Drupal or write a simple module that does that.
Sounds simple to do. Just install the second site using a regular multi-site installation. (Google "drupal multi-site instructions"). Then install the Path redirect module and create the external redirect to the new domain. http://drupal.org/project/path_redirect

Resources