Reputation:
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:
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?Upvotes: 2
Views: 71
Reputation: 3737
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>
Upvotes: 1