Post subject: .htaccess Redirect
Player (121)
Joined: 2/11/2007
Posts: 1522
Apache challenge: use .htaccess to implement a redirect from http://mydomain.com/index.php?somevar=1 to http://mydomain.com/index.php?differentvar=2 Note that the variable name changes and the value of the variable changes. I'm pretty sure this is impossible (!) And yes, I've googled the shit out of this :D
I make a comic with no image files and you should read it. While there is a lower class, I am in it, and while there is a criminal element I am of it, and while there is a soul in prison, I am not free. -Eugene Debs
Player (121)
Joined: 2/11/2007
Posts: 1522
Did I mention that this is... impossible? Yeah, gauntlet thrown down.
I make a comic with no image files and you should read it. While there is a lower class, I am in it, and while there is a criminal element I am of it, and while there is a soul in prison, I am not free. -Eugene Debs
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
If you want exactly one to the other, it's possible. Are you asking for something more dynamic?
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
Joined: 11/22/2004
Posts: 1468
Location: Rotterdam, The Netherlands
Wouldn't that simply be: RewriteCond %{QUERY_STRING} ^somevar=1$ [NC] RewriteRule index.php http://mydomain.com/index.php\?differentvar=2 [L,R=301] This is off the top of my head though. edit: well, 301 isn't needed, but usually a good idea if it's a permanent new location.
Player (121)
Joined: 2/11/2007
Posts: 1522
Dada wrote:
Wouldn't that simply be: RewriteCond %{QUERY_STRING} ^somevar=1$ [NC] RewriteRule index.php http://mydomain.com/index.php\?differentvar=2 [L,R=301] This is off the top of my head though. edit: well, 301 isn't needed, but usually a good idea if it's a permanent new location.
Wow, you answered my question off the top of your head. Good job. I knew this wasn't impossible!
I make a comic with no image files and you should read it. While there is a lower class, I am in it, and while there is a criminal element I am of it, and while there is a soul in prison, I am not free. -Eugene Debs
Lex
Joined: 6/25/2007
Posts: 732
Location: Vancouver, British Columbia, Canada
In the future, when you have a specific programming-related problem, you'll probably get the best results posting on one of the StackExchange Q&A sites (probably Server Fault for this question). People with the knowledge Dada displayed use those sites quite a bit.
Player (121)
Joined: 2/11/2007
Posts: 1522
Aw, but I like spamming the forum :(
I make a comic with no image files and you should read it. While there is a lower class, I am in it, and while there is a criminal element I am of it, and while there is a soul in prison, I am not free. -Eugene Debs