Welcome Guest, Not a member yet? Register   Sign In
Passing full web address (slashes and all) as one segment
#1

[eluser]taurine[/eluser]
I'm making a URL shortening script. I have it working with a normal form, but now I want to make a "services" version, where a 3rd party client like Tweetdeck could convert a URL. I can't necessarily control whether or not that client encodes the URL.

This is my route: $route['tw/(:any)'] = "home/tw/$1";

Ideally, it would work like: http://example.com/tw/http://reallylongu...h/xyz.html

Everything after http://example.com/tw/ would be converted into one variable. I want CI to stop working the slashes when it hits the $1. I tried things like $1- to no avail. Tried throwing urlencode() but couldn't get that working either.

All I'm able to get in my method is the http: part. Any idea how I can get the full URL? Maybe something with .htaccess? Or maybe create a new (:url) type, like (:num) and (:any), if such a thing is possible?


Messages In This Thread
Passing full web address (slashes and all) as one segment - by El Forum - 09-06-2010, 04:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB