Endless redirect loop in Apache
Just for my own future reference and sharing purpose.
I was merging some codes from collegue, which includes a install script which auto generates the .htaccess file and populate the MySQL database tables.
The project is based on CodeIgniter framework. There are two installer php scripts involved, both are called install.php. But one is placed at root level as entry point, the other as CodeIgniter controller under system/application/controller.
The problem is, after firing off the first install.php, it will generates the .htaccess file first, then it will do a redirect by using:
The first install.php works well: it generates the .htaccess file and does the redirect. But the redirect somehow re-run the same install.php at root level instead of the one in the controller folder.
After some tracing and googling, I found that it’s due to some apache configuration:
Changing it to:
fixes the problem. My understanding is MultiView allows URL without file extension and Apache will try to figure it out on the server side.
So in my case, http://localhost/install is the same as http://localhost/install.php and hence the endless redirect loop.
If anyone else had similar problem but have a different solution, I would like to know
ISP + MPAA ?
An interesting read here about aXXo created movie torrents:
http://www.independent.co.uk/arts-entertainment/films/features/scene-stealer-the-axxo-files-1214699.html
Matt Mason, author of The Pirate’s Dilemma, wrote that “when pirates enter our market spaces, we have two choices. We can throw lawsuits at them and hope they go away. Sometimes this is the best thing to do. But what if those pirates are adding value to society in some way?… In these cases, what pirates are actually doing is highlighting a better way for us to do things; they find gaps outside the market, and better ways for society to operate. In these situations the only way to fight piracy is legitimise and legalise new innovations by competing with pirates in the marketplace.”
So what kind of new innovations we can think of ?
I am thinking what if the movie creator (or any content provider) partner up with ISP to provide subscription based torrent download:
- Content provider, obviously, provides the contents
- ISP provides technial expertise
- Since ISP host the tracker itself, they can control who can download within the ISP network
- It’s a distributed distribution model, user will transfer among themselves, they don’t have to download everything from ISP server
The catch is, how to prevent user of re-distributing the content again. I doubt DRM will work (as if it does, it should be already working on MP3 … ). I will say it’s either you don’t do it, or you do it all out and partner with all major ISPs. Put up a price this is low and affordable and people do not see the point of downloading illegally.
Just check iTunes.
Another possibility is by streaming, where partial caching is done at user side but not full caching, so no one will have full movie at their PC. This is already done with products like PPLive, PPSteam. But a product coming out from a ISP shall be more promising. But this approach sounds not much different from video-on-demand, and usualy is paid per view I suppose ?
How to let people to send free SMS to you
Yes, it’s a bit weird. This article doesn’t tell you how to send SMS from YOU to OTHER people, but the other way round. But hey, if you and your friends follow the same steps, essentially all of you can send SMS to each other.
Credit: This is a work not 100% done by me. It was inspired by jym. I mainly provided a wrapper and suggested an alternative on some of the implementation.
So here goes.
First, this is a hack making use of Google Calendar. Google Calendar SMS Reminder service to be exact.
So in order to use it, you will need to have:
- Google Calendar account (I am not sure if you need a Gmail account tho, but its free, so why not)
- Register your mobile number. Check here and here for registering your mobile number.
- Enable the SMS Reminder and set it to 5 minutes by defaut.
- Enable new event invitation like this:

[UPDATED] IMPORTANT NOTE: Just came across someone unable to receive SMS because of this : You need to enable “Automatically add invitations to my calendar” in your Google Calendar->Setting->General
Once that is done, the rest is pretty simple.
I wrote a simple wrapper script here which you can use to send SMS.
All you need to do is simply enter the email address(es) of the recipients. And yes, you can send the same message to many people at once (provided all of them had gone through above steps to enable their SMS service). Multicast anyone ?
The pros of this service:
- It’s free, what else do you want ?
- It can support multicast.
- You can use it as a note taking system, the SMS will reach to your mobile as well as to your google calendar
The cons:
- A bit of techie work up front to make use of the service, but I am sure you will go for the extra mile to save a few bucks
- Currently only support Singapore (GMT+8) timezone (so China, Hong Kong etc should works too)
- Due to the overhead in the message format, each SMS you sent is limited to about 50-60 characters(you can type more than that, but you probably won’t see the full sentence on phone
- Recipients cannot tell who is the sender unless sender indicates in the message
- Cannot reply message directly
With that, have fun !
The script works pretty much the same as what you see on Jym blog entry. The key difference is I used an invite guest technique so you do not need to know the google login credentials of the recipients. This make the solution more elegant, simpler to setup and essentially support multicast. (btw, I suggested this technique but jym coded the new stuff, so I just leeched his code, again, lol)
Some other interesting application we tried: we use the same stuff to auto connect to SBS Iris to fetch the bus info and send a SMS reminder at 6pm everyday. Ding ding, never leave office late anymore !
Spring Cleaning
My local wordpress db is gone. So altho I started to write a few posts but I just gotta redo it.
Anyway Chinese New Year is around the corner (tomorrow is the eve), it’s good to start something a fresh I suppose.
I would like to post something I done recenty out of the fun for it, and also help me save a little money: How to send free SMS to basically anyone using Google Calendar.
Until that happens, I need to spring clean my house. Staying alone at home means you gotta do everythng yourself .