I want to pass a url like http://example.com/test?a=1&b=2 in url segment of codeigniter.
I’m trying to pass something like this http://myurl.com/abc/http://example.com/test?a=1&b=2 and get the “http://example.com/test?a=1&b=2” url. What should be the best way to do this?
Set your URI protocol to
REQUEST_URIinapplication/config/config.php, like this:then use
GETmethod:EDIT:
Since http://example.com/test?a=1&b=2 is not encoded URL, it isn’t possible. So first, I would encode URL with urlencode function like this:
it returns something like:
http%3A%2F%2Fexample.com%2Ftest%3Fa%3D1%26b%3D2So I would pass the URL like this:
then get an example URL with GET method.