Redirecting from www cname not working- I need help!!

Posted by Stephenhawking9 under JavaScript on 6/29/2012 | Points: 10 | Views : 936 | Status : [Member] | Replies : 1
Hi Webmaster experts,

I have installed apache on my windows machine and trying to do a redirect from my site url http://www.fromdev.com to http://fromdev.com.

We are trying to do this for mobile devices and want to read the type of device accessing it. However this keeps failing and we are not sure how to debug this. I am new to apache so please feel free to point me to a beginners tutorial or reference site. I have tried some google search however the information is overwhelming.

Please feel free to move this thread to right location just in case I have posted this in the wrong place. Thanks in advance.

http://www.fromdev.com/




Responses

Posted by: Johnbhatt on: 6/29/2012 [Member] Starter | Points: 25

Up
0
Down
About.com has a good resource about Detecting Mobile Device from JavaScript.
http://webdesign.about.com/od/mobile/a/detect-mobile-devices.htm

Simple javaScript to Detect Mobiles is to Detect their Screen Resolution and Redirect.

<script type="text/javascript">

<!--
if (screen.width <= 699) {
document.location = "mobile.html";
}
//-->
</script>

And to redirect to www from Apache make use of .htaccess page. which is same as Web.Config file in ASP.NET.

John Bhatt
Glad to Know, Free to Share.....
http://www.johnbhatt.com

Stephenhawking9, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response