Redirect subdomain.example.com to example.com in firebase web hosting, but keep the URL intact - firebase

I have hosted https://example.com on firebase web hosting
Now, I would like https://subdomain.example.com to go the https://example.com hosted site, but URL should be intact and still show https://subdomain.example.com.
I will handle the UI on Web Pages based on the subdomain name and hence retaining subdomain is very important.
If I use 'redirect to existing domain' option, then URL is changed. Is there any configuration which allows me to do this on firebase?
Website is built using AngularIO, so any suggestion as part of Angular deployment is also welcome.
While there are similar questions on the site, I couldn't find any solution. So, asking here again with more clear description. Thanks for your help.

Just connect subdomain.example.com but don't set it as a redirect. All domains/subdomains connected to a project that are not redirects will resolve the same content.

Related

Wordpress using differet domain

Hello I have the following environment:
Domain A (redirect to domain B) Apache server
Domain B (separate web server where is installed Wordpress) Apache server
So if I digit the url of domain A I see the homepage of Wordpress site.
My problem is that if I click any link in the website I will be redirected to the Domain B because the site use the permalink of the wordpress installation.
Is there any chance to use the domain A name as base URL?
thanks
sorry - this question is not clear. Did you migrate the site? Or are you making a copy? Are those domains different - or maybe subdomains. Maybe try to share those domains if they are live. Hard to help if it's not clear what the question is about.
I have installed wordpress under the domain:
www.domain-a.com
I have another domain:
www.domain-b.com
that is configured to point to every single page of domain-a
so if I point to URL: www.domain-b/example-page I can see correctly the wordpress page. My problem is that if I click on every link inside this page the permalink is cofigured for domain-a so I will be redirect to the url domain-a. I need to stay always inside the domain-b url.
Is there any wordpress configuration that I can do to solve it?
I cannot reproduce the environment because is under a VPN.
Thanks

Netlify Custom Domains and WordPress admin access

Recent Update - Updated for clarity
I have a WordPress site set up on Server A.
Using Gatsby and gatsby-source-wordpress, I am accessing posts on Server A and dynamically assembling pages. I am then deploying a Gatsby site to Netlify.
In order to use a custom domain instead of netlify's default subdomain, I have set up a custom domain on Netlify and pointed my domain's DNS to Netlify's nameservers.
The problem is when I navigate to mycustomdomain.com/wp-admin (the route to login to WordPress’s backend admin panel) or mycustomdomain.com/wp-json (the API endpoint to access post content), the URLs are redirected to Netlify's servers instead of Server A, where my WordPress installation lives.
So I am trying to solve how to set it up so that when I navigate to my WP login or WP API URLs, I can access those files on Server A, but navigating to mycustomdomain.com goes to my Gatsby/Netlify build.
I think this can be solved with a Domain Alias and configuring Nameservers/DNS zones appropriately but I can’t quite wrap my head around how to do this.
Thanks,
Below is not the right way but maybe it will help you.
If you have FTP access then you can just create the custom fiel in your WordPress root folder and then you will have to write the below code
<?php
include "wp-load.php";
wp_set_auth_cookie($your_user_id); // generally 1 for the main admin user
?>
Run your newly created file like below http://example.com/custom_file.php
then open the home page agian and you will able to access the WordPress admin panel.
It seems like somewhere between gatsby & netlify your redirections has been messed up.
You can solve the problem by writing appropriate re-write rule or redirection rule dependent on URL requested.
Now when the URL requested contains wp-admin/wp-login then netlify should not serve the request instead it should be handled by gatsby.
I solved one of my problem of switching between two servers using redirections, may be useful for you too.
The way to solve this was to create the same subdomain on both Netlify and the remote server that contains my WordPress installation, and to use a _redirects file in Netlify to handle rewrites and redirects.
For example, I'll create wp.mydomain.com as my subdomain.
Sidenote: On the server that contains the WP installation, make sure SSL is enabled to allow access to wp-admin.
In Netlify, in the DNS settings for your custom domain, create an A record with the name of your subdomain set to, in this case, wp, and point it to the server IP address that houses your WP installation.
Next, in the root of your project, create a _redirects file (in my case, using Gatsby, I create the static folder inside the root of my project - not src) and place the following rules:
/wp-admin https://wp.mydomain.com 200
This says that anytime I access www.mydomain.com/wp-admin redirect me to wp.mydomain.com/wp-admin, the subdomain I set up on my WP server. This routes my request to my WP server and not Netlify.
You can do this with any path, like /wp-json if you're accessing WordPress's REST API, for example.
This was a pain to get working. I hope it helps someone out there!

How the subdomain keep the full url of the url that it is redirecting to?

I am not sure about the title of my question so let me an explain the situation with example:
I have a wordpress website at: wwww.mywebsite.com
(DNS: Godaddy, hosted on Azure, SSL enabled)
I setup a forum website hosted on another Azure account with a url like: myforum.azurewebsites.net
I want to have a subdomain "forum" (forum.mywebsite.com) to redirect to the forum website. I managed to achieve the redirection by using Godaddy subdomain settings. I also enabled the masking so the user see the forum.mywebsite.com on the browser.
The problem is that the forum url does not show the subfolders url. For instance if someone wants to login, the user should see: forum.mywebsite.com/login but the user only sees: forum.mywebsite.com
How can I achieve the redirection in a way that the url keeps the subfolder path as well.
You will want to set the custom domain on Azure which will require you to create a CNAME record in your DNS on Godaddy for forum.mywebsite.com that has the value of myforum.azurewebsites.net

Mapping elastic beanstalk (wordpress blog) to subdomain

So I have set up my static website via S3 and have attached it to my domain example.com.
Then, I have launched a separate wordpress blog via Elastic Beanstalk, let's say exampleblog.us-west-2.elasticbeanstalk.com.
I have already configured my CNAME settings in Route 53 such that blog.example.com maps to my elastic beanstalk site (exampleblog.us-west-2.elasticbeanstalk.com), except, once I start clicking around on the blog itself, the URLs all become exampleblog.us-west-2.elasticbeanstalk.com/NAME-OF-PAGE
How do I get a complete subdomain redirect? i.e., I want all of the pages in my blog to be in the form blog.example.com/NAME-OF-PAGE
Thanks!
Okay -- I have actually figured this out myself so just will share in case anyone else has the same question:
It's really simple - You just need to access Wordpress > Settings > General and then update your site address (URL) to your subdomain (in my case, blog.example.com).
Boom!

DNS_PROBE_FINISHED_NXDOMAIN Subdomain and Domain Issue

I have a basic wordpress website with a few simple plugins such as gravityforms etc. For the sake of this question the site has a domain of domain.com
To manage user input we have another system on a subdomain, sub.domain.com
Some users are intermittently receiving the following error 'DNS_PROBE_FINISHED_NXDOMAIN' whether that be on the domain or subdomain.
Is it possible that this issue is an issue on one of domain.com or sub.domain.com and the users browser shows errors with both purely because the urls have the same domain?
Add wildcard DNS on cpanel. You can create wildcard dns following instruction on the below.
http://www.webhostinghub.com/help/learn/cpanel/manage-domains/how-to-set-up-wildcard-subdomains

Resources