10th April, 2010
Since my original posts on mobile redirection in .htaccess files I’ve gotten some comments and emails asking for step-by-step guidance on exactly how to “install” these rules. I hope this post will answer some of those questions.
Before you continue reading, if you have php installed on your server, you may want to consider Andy Moore’s php based detection solution.
The Basics
First off, some basic requirements. You’ll need:
- Apache/Linux Hosting. Microsoft’s IIS has a completely different method for handling this sort of thing.
- FTP access.
- Apache mod_rewrite enabled. Depending on the type of hosting you have, it may be difficult to determine if you have this module installed and it may be impossible to enable if you don’t. If the steps below simply don’t seem to work, there is a good chance you don’t have mod_rewrite installed. Ask your tech support.
- Mobile site in a subdirectory, eg. www.yourdomain.com/m/. This set of rules I’ve posted will not work with a mobile subdomain.
The Steps
- Download mobilerules2.1.txt.
- Open the file in your favorite text editor, replace the 2 instances of “mobiledirectoryhere” (without quotes) with the directory name you are using for your mobile site. Save it.
- Open FTP client, enable ‘view hidden files’ – files beginning with a dot are hidden on linux. This option is typically buried in a “view” menu or something to that effect. Results may vary.
- Navigate to your site’s webroot (probably ‘htdocs’ or ‘www’).
-
- If there is already a .htaccess file present in the directory. Download it, open it in your favorite text editor. Copy & paste the contents ofmobilerules2.1.txt into the file. Save it, upload it.
- If there is no .htaccess file present. Upload mobilerules2.1.txt as is, rename it to .htaccess.
- Your Done. Test it from a mobile device.
If you have any questions please leave a comment.
Note: This script treats all opera mini, iphone and android the same as other phones and browsers. Leave some comments if you’d like me to address this.
apache mobile browser programming rewrite rule server in HowTo Tips
7th January, 2010
If you’re tired of websites resizing your browser window, rest your weary head. In Firefox, you can disable website’s abilities to do this with Javascript:
- Tools-> Options (Firefox -> preferences or ⌘, on OS X)
- Select the “Content” tab.
- Click on the “Advanced” button across from “Enable JavaScript”.
- Uncheck the “Move or resize existing windows” checkbox.
Thanks to reddit user libertao, another one of the many bits of knowledge I’ve learned from comments on reddit.
firefox in HowTo Tips
30th September, 2009
If the email thread is already 29 messages long, do not reply-all with “Thanks.”
in People Suck At Email Tips
1st September, 2009
It’s 2009, I can’t believe I just had to send this email.
When you add recipients to the “CC” list you expose all recipients email addresses to everyone else on the list. By doing this you have inadvertently sent your entire client list to all of your clients.
In the future please use BCC.
For more information, see wikipedia: http://en.wikipedia.org/wiki/Carbon_copy#E-mail
email in People Suck At Email Random Tips
15th August, 2009
UPDATE: Some visitors are reporting that this works for Hulu as well.
The relationship between Comedy Central and Canada’s Comedy Network is the worst example of what can happen when rights owners assert copyright on the internet, based on national borders. If you are not aware – like Hulu, TV.com and others – Comedy Central videos will not play in Canada, but it’s worse. ComedyCentral.com – the entire domain – is unavailable to Canadian IPs! When you try visit it, you are redirected to comedynetwork.ca.
I found a workaround to this buried in a comment thread on reddit. Firefox users only:
For Canadian viewers, if you are using firefox, install the following addon:
http://addons.mozilla.org/en-US/firefox/addon/967 then:
1) In Firefox, Go to tools->modify headers
2) From the drop down box on the left select add
3) Then enter: “X-Forwarded-For” in the first input box without the quotation marks
4) Enter: “12.13.14.15″ in the second input box without the quotation marks
5) Leave the last input box empty, and save the filter, and enable it
http://imgur.com/Feb4.png
6) Click the ‘Configuration’ tab on the right then proceed to check the ‘always on’ button.
Close the Modify Headers box and it should work.
[orginal post]
Works like a charm!
in HowTo Tips Websites