This is new territory for me, sorry if this is wacky. I’ve been studying this thread on the topic and have working version locally. I’ve got the urldecode() working too.
Where I’m struggling is what to do if my URL isn’t as orderly as some&data, where there’s just 2 words with an ampersand.
RewriteRule ^tests/(.)\&(.)$ test.php?test_var=$1\%2526$2
I’m trying to figure out what I’d use for say 3 or more, not that this will happen, but I’m curious. What if I have something like /test/you&me&them?
RewriteRule ^tests/(.*) ./test.php?test_var=$1
on /test/you&me&them
echo’s :: hello test: you
Do I get this right? … I think I see how the regex finds ‘all’ then an escaped ampersand then ‘all’ again. then the Destination puts an ampersand between the 2 destination variables. Is there a way to create ‘n’ number or search groups with an ampersand between and ‘n’ number of destination variables?
Any guidance or insight would be appreciated. Does it make sense what I’m trying to get at?
The best guidance I can give you is to read the techo-geek treatise on URI Syntax by Tim Berners Lee: Uniform Resource Identifiers (URI): Generic Syntax where you will learn what characters are allow, which are allowed under certain circumstances and which are prohibited.
Thanks for the link David! I was hoping the USPS was going to put Tim Berners Lee on stamp, when they lifted the “you need to be dead to be on a stamp requirement”.
Now I think it’s unlikely that I’ll need a clean url with multiple ampersands. That’s just silly… especially if I’m in control of the names to some extent. I’ve got a nice working setup with the .htaccess file as it is now. I’m using PHP to clean up the variable and use it in the page titles and to connect to the db, so far things are working nicely… sofar I’ve got a new question that relates to .htaccess files and a local Mac testing environment, but I think I should start a new thread.
The jist is I’m using a vhost file for my local testing, but then I’d like to be able to hit that domain from other machines, iPhone or iPad from within my local network. So, where I’ve got a site on my local development at: dev.mysite.loc/projects/dave I’d like to be able to hit that same site (directory) from within the local network at say: 10.0.1.17/dev-mysite-directory/projects/dave.
I’ve learned that I can add the domain to the hosts file on other computers and use the same domain, but is there something I can do for something like an iPad or other device where I can’t get at a hosts file.
I’m going to do some research too. The goal is to be able to test my rewrites on other devices within my local network.
You’ll need to amend your httpd-vhosts.conf and hosts file on the “server,” too, to add the 10.whatever IP address. As far as your iWhatnot devices, perhaps using the server’s IP address will do the trick for you? At least it’ll get you close.