Wednesday, October 14, 2015

GoDaddy Domain Forwarding

Every so often, I get asked to forward a domain purchased at GoDaddy to some other URL.  Its easy to do, but since I don't do it often, I forget exactly how to do it.  So I decided to document it here.

NOTE: This will forward both www.mydomain.com AND mydomain.com

1) Log in to GoDaddy and open up Domains

2) Find the domain name you want to forward and click the MANAGE button

3) When the "Domain Details" page appears, there is a Forwarding section down the page in the Settings tab.  It should say "Domain: Off" if it isn't forwarding.  Click the "Manage" link below that.

4) Then you will get a popup dialog box titled "Forwarding and Masking".  Click the green "Add Forwarding" button.  The dialog box will change to look like this:


5) Simply type/paste in the URL you want to forward to, without the http.  Be sure to change the dropdown to use the correct protocol you want, http or https. I keep everything else as-is: 301 (Permanent), Forward Only, and keep the check box checked.

6) Click Add on this screen, then Save when you get back to Forwarding and Masking

The changes can take a few minutes to take affect.  And www.mydomain.com my take affect some time before (or maybe after) mydomain.com, without www.  But within an hour or a lot less, both versions should be forwarding to the URL you specified.

Tuesday, June 2, 2015

Android Java Spinner for United States with postal abbreviations

For the Android version of Monster Cache, I wanted a spinner on my registration page that showed all of the 50 United States.  But when a user chose a state, I wanted to save the US postal abbreviation rather than the state name.  This seems like a common thing people would want to do, but I couldn't find any example, so I thought I would post mine.

First I created two arrays -- one with state names and one with state abbreviations.  Then I loaded the array of names into the spinner using an ArrayAdapter.


                stateCodes = new String[52];  // 50 states + DC + blank
                stateNames = new String[52];

                // set first item to blank
                int stateCount = 0;
                stateCodes[stateCount ] = "";
                stateNames[stateCount ++] = "";

            // now add all US states
            stateCodes[stateCount]= "AL";
            stateNames[stateCount++] = "Alabama";
            stateCodes[stateCount]= "AK";
            stateNames[stateCount++] = "Alaska";
            stateCodes[stateCount]= "AZ";
            stateNames[stateCount++] = "Arizona";
            stateCodes[stateCount]= "AR";
            stateNames[stateCount++] = "Arkansas";
            stateCodes[stateCount]= "CA";
            stateNames[stateCount++] = "California";
            stateCodes[stateCount]= "CO";
            stateNames[stateCount++] = "Colorado";
            stateCodes[stateCount]= "CT";
            stateNames[stateCount++] = "Connecticut";
            stateCodes[stateCount]= "DE";
            stateNames[stateCount++] = "Delaware";
            stateCodes[stateCount]= "FL";
            stateNames[stateCount++] = "Florida";
            stateCodes[stateCount]= "GA";
            stateNames[stateCount++] = "Georgia";
            stateCodes[stateCount]= "HI";
            stateNames[stateCount++] = "Hawaii";
            stateCodes[stateCount]= "ID";
            stateNames[stateCount++] = "Idaho";
            stateCodes[stateCount]= "IA";
            stateNames[stateCount++] = "Iowa";
            stateCodes[stateCount]= "IL";
            stateNames[stateCount++] = "Illinois";
            stateCodes[stateCount]= "IN";
            stateNames[stateCount++] = "Indiana";
            stateCodes[stateCount]= "KS";
            stateNames[stateCount++] = "Kansas";
            stateCodes[stateCount]= "KY";
            stateNames[stateCount++] = "Kentucky";
            stateCodes[stateCount]= "LA";
            stateNames[stateCount++] = "Louisiana";
            stateCodes[stateCount]= "ME";
            stateNames[stateCount++] = "Maine";
            stateCodes[stateCount]= "MD";
            stateNames[stateCount++] = "Maryland";
            stateCodes[stateCount]= "MA";
            stateNames[stateCount++] = "Massachusetts";
            stateCodes[stateCount]= "MI";
            stateNames[stateCount++] = "Michigan";
            stateCodes[stateCount]= "MN";
            stateNames[stateCount++] = "Minnesota";
            stateCodes[stateCount]= "MS";
            stateNames[stateCount++] = "Mississippi";
            stateCodes[stateCount]= "MO";
            stateNames[stateCount++] = "Missouri";
            stateCodes[stateCount]= "MT";
            stateNames[stateCount++] = "Montana";
            stateCodes[stateCount]= "NE";
            stateNames[stateCount++] = "Nebraska";
            stateCodes[stateCount]= "NV";
            stateNames[stateCount++] = "Nevada";
            stateCodes[stateCount]= "NH";
            stateNames[stateCount++] = "New Hampshire";
            stateCodes[stateCount]= "NJ";
            stateNames[stateCount++] = "New Jersey";
            stateCodes[stateCount]= "NM";
            stateNames[stateCount++] = "New Mexico";
            stateCodes[stateCount]= "NY";
            stateNames[stateCount++] = "New York";
            stateCodes[stateCount]= "NC";
            stateNames[stateCount++] = "North Carolina";
            stateCodes[stateCount]= "ND";
            stateNames[stateCount++] = "North Dakota";
            stateCodes[stateCount]= "OH";
            stateNames[stateCount++] = "Ohio";
            stateCodes[stateCount]= "OK";
            stateNames[stateCount++] = "Oklahoma";
            stateCodes[stateCount]= "OR";
            stateNames[stateCount++] = "Oregon";
            stateCodes[stateCount]= "PA";
            stateNames[stateCount++] = "Pennsylvania";
            stateCodes[stateCount]= "RI";
            stateNames[stateCount++] = "Rhode Island";
            stateCodes[stateCount]= "SC";
            stateNames[stateCount++] = "South Carolina";
            stateCodes[stateCount]= "SD";
            stateNames[stateCount++] = "South Dakota";
            stateCodes[stateCount]= "TN";
            stateNames[stateCount++] = "Tennessee";
            stateCodes[stateCount]= "TX";
            stateNames[stateCount++] = "Texas";
            stateCodes[stateCount]= "UT";
            stateNames[stateCount++] = "Utah";
            stateCodes[stateCount]= "VT";
            stateNames[stateCount++] = "Vermont";
            stateCodes[stateCount]= "VA";
            stateNames[stateCount++] = "Virginia";
            stateCodes[stateCount]= "WA";
            stateNames[stateCount++] = "Washington";
            stateCodes[stateCount]= "DC";
            stateNames[stateCount++] = "Washington DC";
            stateCodes[stateCount]= "WV";
            stateNames[stateCount++] = "West Virgina";
            stateCodes[stateCount]= "WI";
            stateNames[stateCount++] = "Wisconsin";
            stateCodes[stateCount]= "WY";
            stateNames[stateCount++] = "Wyoming";

            Spinner dropdown = (Spinner)findViewById(R.id.register_state);
            ArrayAdapter<String> adapter = new ArrayAdapter<String>(m_thisActivity, android.R.layout.simple_spinner_item, stateNames);
            dropdown.setAdapter(adapter);


When I process the registration form, I just index the stateCodes array using the index selected in the Spinner, like this:

                Spinner states = (Spinner)findViewById(R.id.register_state);
                String selectedState = stateCodes[states.getSelectedItemPosition()];

Thursday, April 30, 2015

Step-by-step guide to purchase SSL certificate at GoDaddy, install at 3rd party host

My last blog post was a Step-by-step guide to transfer a domain name to GoDaddy.  Another process I have to do occasionally that involves quite a few steps is purchasing and installing an SSL certificate.  To me, these steps are easier to figure out than the domain transfer steps, but there are still enough of them that I wanted to write them down. I'm installing my SSL Certificate at DiscountASP.Net, but the process should be almost identical for installing at any other 3rd party web host.

One thing to note before purchasing the certificate...if you have an existing certificate, then you'll probably want to "Renew" it.  If you have an existing certificate that is expiring and you follow these steps, then you'll be completely replacing it with the new one.  If your existing one actually has two months before it expires, then you'll really be wiping out those two months since your new certificate will be good for 1 year (or however many you purchase) from the day you create it.  Existing certificates can be renewed, but these instructions are for a new one.

1) Log in and go to the SSL Certificates section of your "My Account" page.  First we need to buy a new SSL certificate credit.  Click "Buy Additional Plans"


2) The next screen that comes up is just a promotional splash screen.  Just click "Get Started" to get to the next page.

3) The next page lists the types of SSL certificates.  I've always just purchased Standard SSL.  It protects one full domain name, like www.mydomain.com.  It does not cover subdomains like mysub.mydomain.com.  I don't care about that.  I usually have a server side script on all my pages that require SSL  that checks if the page is using https, and if not, then it redirects them to the URL that does use https.  So at that time, I can also change the domain name to the specific domain name that I'm purchasing the certificate for.  Then select your term (one to three years) and click "Add to Cart"

4) Enter a promo code if you have one, otherwise just click the "Proceed to Checkout" button

5) Check your contact info and payment type, agree to terms and click "Place Order".  Hopefully you'll see a confirmation that says something like "Go Time".  If so, click on the SSL Certificates button, which takes you back to SSL Certificates section of My Account.  Now you should see a new entry that says "STANDARD SSL (1 YEAR) (ANNUAL)", or something similar for whatever type and term you purchased.


6) Click "Set Up".  Then there will be a pop-up that asks "Which order do you want to associate with this SSL Certificates account?".  You probably will have only one item in the drop down list, so just choose that one.  When the popup closes, you won't see the new certificate right away.  But if you just leave the page open a little while, it will refresh itself and then you'll see the new certificate listed as "NEW CERTIFICATE", as below

7) Click Manage.  That will take you to the Certificates management area.  There is a line for each of your certificates.  On the line for your "New certificate", there is a Set Up icon.  Click that.

8) Finally, we've reached the screen to enter the Certificate Signing Request (CSR).  This CSR must be generated by the server on which you plan to install he certificate.  That means its time to move to your 3rd party host.  In my case, this is DiscountASP.Net.  Keep this window open.

9) In a new window, log in to your web hosting account.  You should have some option for SSL Management on your hosting account.  When you find it, it should let you generate a CSR.  Here is how it looks at DiscountASP.Net


10) Generate the CSR. It will ask you to supply the fields shown above: Common Name, Organization Name, Organization Unit, City, State, Country.  The Common Name is the specific domain for which you want the certificate to work, so be sure to choose and enter that carefully.

NOTE: Your web hosting company may charge you an additional fee in order to install a certificate.  This is because they may need to give you a static IP address if you don't already have one.  The SSL Add-on at DiscountASP.Net is $10/month.

11) Your host will generate a huge block of text that starts with "-----BEGIN NEW CERTIFICATE REQUEST-----" and ends with "-----END NEW CERTIFICATE REQUEST-----".  Copy *ALL* of that, including those BEGIN and END lines, and paste it in the CSR form back at GoDaddy.  Agree to the terms and then click "Request Certificate"

12) Now you just have to wait a little while.  If your domain is registered at GoDaddy, then they know you own it, and they will skip you through the Domain Ownership verification.  Otherwise, you may have to put a file on your server so that GoDaddy can verify that you own the domain


13) After waiting several minutes, your certificate will be issued and you should see something like below.  Click Download.  (If you have to complete  verification steps GoDaddy asks you to do, then you may not get to the Download option on this screen, but you can find it back in the SSL Certificates section of My Account.

14) Choose the server type on which you are installing -- IIS, Apache, etc. -- and click "Download Zip file".  Save it wherever you want.  The .zip file has the files that you need that are relevant to the server type you choose.  In the case of IIS, the file we'll be after is the .crt file in the zip file (that may be true for all server types)

15) Extract the contents of the zip file and open the .crt file in a text editor, like Notepad.  This file contains another huge block of text that starts with "-----BEGIN CERTIFICATE-----" and ends with "-----END CERTIFICATE-----"

16) Copy *ALL* the text from the file, including the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----, and go back to the SSL management at your web host.  There should be a text box where you can paste in this copied text.  At DiscountASP.Net its on the same page as the CSR, and it says "Install your SSL Certificate".  Paste your certificate text into that text box and click "Install Certificate" (Of course I got logged out while I was over at GoDaddy, so you may want to make sure your session is still active)

That's it! If the installation is successful, then your new certificate should be active right away.

Saturday, March 28, 2015

Step-by-step guide to transfer a domain name to GoDaddy

I've transferred domain names several times, usually (maybe always) to GoDaddy. Many people don't like GoDaddy for good reasons.  I already have many domains registered there for myself and clients, and I have always found that they have really good customer service, and their prices are good, so I'm not ready to switch yet.  Note that I am speaking strictly about having good experiences with their domain registration service, I definitely do not recommend using them as a web host.

Anyway, I don't do domain transfers often, and every time I do a transfer it seems like something goes wrong.  Or nothing goes wrong, but the process is just so confusing that it seems like something is not working, when really its just taking a while, or I misunderstood something.  So finally I am going to document the process so that I can refresh my memory for future transfers.  Here are the steps that I follow to do a transfer to GoDaddy.

1) Turn off "Registrar Lock" or "Transfer Lock" at your original registrar.

2) Turn off "Privacy Protection" at your original registrar.  If you have some kind of Privacy Protection, then the administrative contact email will not be your own email, but an address at the registrar company or some other company they contract with. Theoretically, whatever address that is *should* forward to you, but it may take a lot longer or it may not work at all.  So its best to just turn off the protection.

3) Log in to your GoDaddy account.

4) Purchase the transfer on GoDaddy.  In their main menu, its under Domains, and then choose "Transfer Domains".  You'll be asked to enter the name of the domain that you want to transfer, and then you will proceed through check out. They have good prices on transfers, like $9.99/year plus a free year, so I recommend buying a lot of years now.  I also usually buy Privacy Protection.



5) Once you make the purchase, TWO emails should be sent to the administrative contact for the domain.  The first comes from GoDaddy and should contain two keys:
  • Transaction ID
  • Security Code
The second email comes from your original registrar and should contain one key:
  • Authorization Code
In the current transfer I'm doing, we did NOT turn off the Privacy Protection ahead of time and it took over two hours before we received both emails.  Hopefully you'll get them much faster if you had already turned off Privacy Protection.

5) Go back to GoDaddy and again from their Domains menu, choose "Manage My Domains"

6) Now you'll be in the domain management area.  From there, go to the Domains menu and choose "Transfers"

7) Now you should see your Pending Transfers with your domain name listed in the table.  The Status column should say "Authorization code needed".  Click on that message.  You will see the "Authorize Transfer" dialog box.


8) Click "Add Transfer Codes"

9) Now you will be asked for the Transaction ID and Security Code from one of the emails.  Enter those.

10) After adding those, you will be back at the "Authorize Transfer" box with your Transfer Code listed in the table.  Click Next.

11) Now enter your Authorization Code that came in the other email, check the box that says "I authorize the transfer..." and click FINISH!

That's it!  You'll see a message that says the transfer has been initiated, but could take 15 minutes to take effect.  If you refresh your Pending Transfers table, the Status should now say "Processing Transfer".  Clicking on that message gives a disturbing warning.  "We're waiting for approval from the sending registrar, which can take up to 7 days."  I will try to update later on how long it really took, but it does depend on your original registrar.  Some take longer than others.