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

Posted by Stephenhawking9 under JavaScript on 6/29/2012 | Points: 10 | Views : 1021 | 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 to

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.


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

Down has a good resource about Detecting Mobile Device from JavaScript.

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";

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.....

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

Login to post response