2

I have few questions regarding subdomains in my mind. I know how to get a subdomain and redirect to it using .htaccess or placing js file in our directory.

My questions are:

  1. Suppose I have a website www.mysite.com and I want to redirect mobile users to m.mysite.com. Can I place js file with redirecting code anywhere in the directory or should it be in specific path?
  2. I want different functioning and styling for mobile users for which I have to write a separate code. Where will I place this mobile friendly code and link it to redirecting code? I don't want to use any app or web service for this.
  • 1
    You may want to find a development forum (perhaps [quora](http://www.quora.com/Computer-Programming)?) to work out generalities. Then, when/if you have specific coding issues, come back to StackOverflow and we'll be glad to help. – Jay Blanchard Sep 11 '15 at 13:27
  • What is **itaccess** ? – Amit Verma Sep 11 '15 at 13:49

1 Answers1

1

Suppose I have a website www.mysite.com and I want to redirect mobile users to m.mysite.com.

This could save your day: What is the best way to detect a mobile device in jQuery?

Can I place js file with redirecting code anywhere in the directory or should it be in specific path?

It doesn't depend where you put the .js file, you have to include it in the respective file.

<script src="path/to/file.js"></script>
Community
  • 1
  • 1
sitilge
  • 3,569
  • 4
  • 27
  • 49