Pass variable with slashes in URI without it being interpreted as another segment |
[eluser]Unknown[/eluser]
I'm creating an image hosting site, I'm using mod_rewrite to intercept all incoming requests to the root folder where images are stored - /i/ - and silently redirecting it to a CI controller that will record various things about the image being accessed and then set the required header type and output the image. I've got it working at the moment using a separate php file and using mod_rewrite to pass the requested image as a GET variable i.e RewriteRule (i/.*) access.php?i=$1 [L] But now I want to point it to my CI controller http://localhost/images/access/IMAGE_PATH which would be done like: RewriteRule (i/.*) images/access/?i=$1 [L] However the GET parameter never makes it, and if I try images/access/$1 then CI interprets the slashes in the image path as segments and I can't access the entire path using $this->uri->segment(3); Is there a way around this and if so what is the "correct" way of doing so? Any help is appreciated.
[eluser]Unknown[/eluser]
I've worked around this by enabling GET variables as per http://ellislab.com/forums/viewreply/277621/ And updated my mod_rewrite rule to: RewriteRule (i/.*) images/access/?i=$1 [L] I'm going to push on ahead now but I'm still very interested if there's a more correct way of doing this thanks ![]() |
Welcome Guest, Not a member yet? Register Sign In |