.htaccess - convert querystring variables into url segments? |
[eluser]Matthew Pennell[/eluser]
I'm having an .htaccess problem, hopefully someone can help me out. I'm working on something that uses a third-party remote API which it accesses via cURL, but the API only uses querystrings to return the authorization key to my app. So I can set the callback URL, but it will always send back the response as: http://localhost/myapp/controller/method...d1e1f1f1e1 Obviously this isn't much use to CodeIgniter, so I thought I could use .htaccess to intercept those requests and rewrite the url to make the token into a url segment: http://localhost/myapp/controller/method...d1e1f1f1e1 Here's my .htaccess: Code: RewriteEngine on Unfortunately, this setup gives me a 500 Internal Server Error. Anyone know how to do this properly?
[eluser]Matthew Pennell[/eluser]
I gave up in the end. Basically I just redirected the auth_token matching URLs to another page (outside of CI) that did a simple header() redirect to the relevant controller/method with the auth_token appended as url_segment(3). Code: RewriteCond %{QUERY_STRING} ^auth_token=(.*)$
[eluser]huzzi[/eluser]
I'm having this same problem, is it not possible to do it with htaccess? I tried the code below but it does not work. Code: RewriteCond %{REQUEST_URI} ^payment\.html$ Any idea?
[eluser]Eric Barnes[/eluser]
Editing these in config should work: Code: $config['uri_protocol'] = "PATH_INFO";
[eluser]huzzi[/eluser]
I managed to get it to work with the mod_rewrite code below if anyone interested. Code: RewriteCond %{REQUEST_URI} ^/payment\.html$ |
Welcome Guest, Not a member yet? Register Sign In |