I have a mobile version of my site working now and I want to know where should I do the redirection. I only can think to do redirection using:
I would like to know which one is better/more efficient? Is there a better way to do that other than in the .htaccess or PHP?
Thanks
I vote for Apache.
If you do it at the Apache level (in the .htaccess
file or, even better, in the Apache config), then if you have HTML files, the only way to detect this that I can think of is JavaScript; this can be easily removed (like disabling JavaScript).
This also applies to other types of files, like PDFs, Word documents, MP3 files, etc. It can easily redirect to a page that contains a "not available for mobile" message.
The other thing I can think of is a css file if they are different (standard version vs mobile version).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With