I did some research on how to redirect to a mobile website. The designer of the template I used had a great blog post how to redirect to a mobile site. This one was interesting because it also mentioned how to use cookies to prevent someone from going back to the mobile site if they clicked on the link to go to the full version website. I added the code to the HTACCESS file and make the changes. The changes talked about using a subdomain but tried with my subfolder.

Either way, I realized that I would need to setup a subdomain with my DNS hosting at Hover. I found the area to forward a subdomain to a subfolder. Everything looked right but the forwarding didn’t happen. I thought maybe I would need to wait for DNS prorogation but I tried with another test subdomain and nothing seemed to work. So, I did some more research.

I next found a great blog post on how to redirect mobile users on your website. The blog post mentioned a number of ways to do the redirection including a hyperlink to the HTACCESS method I was trying. One of the methods was to use JavaScript. The method looked very straightforward and was based on screen size. The blog posted pointed to this mobile redirection example and this other mobile redirection example. I tested this and it worked but there was the mention that this method wasn’t the best because smartphone are increasing in screen resolution.

However, I still like the HTACCESS method better. So, I decided to figure out how to get the subdomain to work. I decided to figure out how to create a standalone website for the mobile version. I searched Media Temple support and found how to the add a subdomain. After a few minutes, a new hosting folder was created. I moved all the files and the new website http://m.clearskytonight.com worked great. I tested the HTACCESS method with the proper URLs and it worked too. The cookie redirection prevention worked too.