I am new to Firebase but I am the owner of a project.
I have also given permission to someone to be an "editor" of the project.
Initally there was only 1 site and URL for my project. In the hosting, I now notice that are 2 sites for the same project. One with the url mydomain.web.app and the other with mydomain-f9745.web.app.
When I deploy code it goes to the first domain and when the editor deploys it goes to the second domain. Can anyone explain what is happening here. It seems that when the editor deployed the code for the first time, it created a new domain instead of using the existing one.
I have also tried to see how I delete the second site but I don't see that option.
Can anyone explain why this second site it being created please?
once you set up firebase hosting you're automatically allocated with a domain .web.app.
Seems, like mydomain-f9745 might be the one that is the default one.
Anyway, you can add more web.app domains to your project like mydomain.web.app.
I'm not sure about the difference you're saying between just "deploying" and "deploying from your code editor".
Note that you can specify the default site to be deployed to on your firebase.json file like this:
{
"hosting": {
"site": "my-site"
/// other hosting config
}
}
Just add a "site" property inside "hosting", and enter the site name (Do EXCLUDE .web.app).
Hope this helps!
Related
Using the Firebase console, I created a project and two apps, connected my own domain, and set up a few dynamic links.
Everything works perfectly!
Now I need to add some redirects in the hosting section in firebase.json. I have installed the CLI for this.
The problem is, I don't know how to get the firebase.json file generated by the console in order to modify it.
It is probably an easy question but I am not able to figure it out. I have a project that I have configured in Firestore to have a domain like "loremipsum.web.app". However, when I do the firebase init and then firebase deploy, it is hosted in "loremipsum-9dd7.web.app" which is the project id. I would like to have it without the hyphen and that id number. How can I do it?
Here’s a screenshot of the hosting section of my project. The first one is the one I want to host in and the second one is where it is hosting.
That is something you can't do. The reason there are those numbers is that someone else already is using that app name loremipsum for his project. When you have choosen your Firebase project name you had the same and Firebase added those numbers to make your project name unique.
Just to make it clear. Even if your name is as you tiped it the "real" project name will be the one with the numbers as you can see on this example:
I can see in most places the name I tiped in but Firebase will use the one with the numbers for hosting.
So if you would use the domain without the numbers you would land on his project and not yours.
To have a nice domain just connect a custom one to your Firebase project. You can read more about it here.
It looks like you manually added a second site to your project. You should check this documentation on how to handle such situations. You need to change your firebase configuration and defined on witch target to deploy your site.
I re-design a SPA that is deployed in firebase with custom domain, I have done all my test on another firebase project, now I would like to deploy the new version to the public app by creating a new folder, lets say public2 in the public project, change the entry in firebase.json and then do a new firebase deploy.
Can this be done? and in case I will like to return to prior version, be able to change it back ?
thanks
Actually the solution was straight forward, just copied the code of the new site to a new folder and changed the firebase.json entry to referring this new folder.
then issue firebase deploy again.
Hope this helps someone else.
I have an instance of Silverstripe that we have copied off a webserver that we host. We are trying to get it running locally so we can modify it but when I run it locally all assets point to the live site. Also I cannot access the login, or Admin pages of the CMS.
When I try access any local pages it states "Server Error" in the page content
Is there a place in the code where I can change the paths to assets to local, and also access the Admin area?
Assuming you're running a local copy of the database, and don't have any exotic changes to the way File is handled SilverStripe should be resolving file paths using the BASE_PATH and BASE_URL constants.
For logging in you'll want to add to the bottom of mysite/_config.php locally something like:
define('SS_ENVIRONMENT_TYPE', 'dev');
SSViewer::set_source_file_comments(true);
ini_set('display_errors', 0);
error_reporting(E_ALL);
Security::setDefaultAdmin('admin', 'admin');
// Email::setAdminEmail('admin#example.org');
define('SS_LOG_FILE',dirname(__FILE__).'/'.basename(dirname(dirname(__FILE__))).'.log');
ini_set('error_log', SS_LOG_FILE);
Director::set_environment_type('dev');
This should give you enough debug information to solve most issues.
I would use something like https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ (which also works for Silverstripe), to do a search and replace for all occurences of the old domain.
This would mainly work for images paths that are inside of content fields of course. Otherwise, SS should automatically convert the paths, as the accepted answer suggests.
I want to do developments on my client's website but by making a clone of it. So, main website url is: http://website.com and the clone i am trying to create is: http://test.website.com.
So far i've done the following:
copied entire root directory into public_html/test dir (with folders config,field,FirePHPCore,fontyourface,includes,js,misc,modules,scripts,sites,styles and themes)
created a subdomain in cPanel for test.website.com
checked the file settings.php (inside sites/default folder) for $base_url but found it commented, so left it as it is unchanged.
copied db via phpMyAdmin and updated the new db details in settings.php (inside sites/default folder).
inside the table variable, two rows with the name securepages_basepath and securepages_basepath_ssl. Changed their values from http://website.com to http://test.website.com (using the variable_get and variable_set functions).
Now i can access http://test.website.com but when i click on login (from header) it takes me to http://website.com/user and if manually type http://test.website.com/user and login then it takes me to http://website.com/users/admin then i have to manually type in correct address http://test.website.com/users/admin.
And when i logout, it again takes me back to http://website.com.
So i want to know how can i completely make it to work on http://test.website.com?
Are there more variables to change?
And how i can make 100% sure that the test site is only using test and not the live site. I am afraid of messing up live website.
Please advice, thanks!
I fixed it by disabling the secure pages from inside the mysql database. It was inside variable table and securepages_enable field. It was in blob so i had to download the blob first and opened it in notepad and changed the value inside it from 1 to 0 and then uploaded it back by updating the securepages_enable field.
I had to do this because after logging in from my test url, the urls were redirecting back to the live website, so whatever change i was making, it was all affecting the live site.
Hope this helps to someone with similar case. Thanks!