IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Somehow I can't read docs for Apache and RewriteCond/Rule
ReWriteCond %{QUERY_STRING} ^pagename=Urgent_Bloating_Gas
ReWriteRule ^/(.*) http://www.somedomain.org/UBG [R=301,L]

First off I don't particularly about any Query String, nor do I care what the original URL was, only thing I care about is this:

If *ANY* variable in the query string arguments = something, I want a hard redirect to this particular web-server and this particular URI.

For some reason... this setup ain't workin' and I;ve got a "novel" full of these I have to make.

http://www.somedomain.org/diff_non-qs-redirect?pagename=Urgent_Bloating_Gas

Bleah.
Expand Edited by folkert March 26, 2012, 04:18:32 PM EDT
New Can't you do a partial match?
*=Urgent_Bloating_Gas[&\b]

IOW if it's "=" followed by your string followed by an ampersand or a word boundary then it's a variable.
--

Drew
New Re: Somehow I can't read docs for Apache and RewriteCond/Rul
since you dont care about the string, this should work
ReWriteRule ^pagename=Urgent_Bloating_Gas(.*) http://www.somedomain.org/UBG [R=301,L]
Any opinions expressed by me are mine alone, posted from my home computer, on my own time as a free American and do not reflect the opinions of any person or company that I have had professional relations with in the past 55 years. meep
New Re: Somehow I can't read docs for Apache and RewriteCond/Rul
Actually:

http://www.thisdomain.org/site/Pages?pagename=Urgent_Bloating_GAS

Need to goto:

http://www.somedomain.org/UBG

I'm taking a break for a few hours... thinking about it. I'm sure I'll fix it... but please anyone else?

There are about 250 of the specific pages... from one old domain getting transferred to a new domain, with *COMPLETELY* disparate mechanisms. The old one SUCKED... the new one uses QS to do functions rather than display content.
Expand Edited by folkert March 27, 2012, 08:50:31 AM EDT
New email be the url got minged
Any opinions expressed by me are mine alone, posted from my home computer, on my own time as a free American and do not reflect the opinions of any person or company that I have had professional relations with in the past 55 years. meep
New The commands are case sensitive
Try RewriteCond and RewriteRule

Also, the caret in the RewriteCond rule will limit a match to the first parameter while you're looking for a match in any pair. Last, as you don't care about the original URL, the RewriteRule match can be set to ^$. That'll match anything you throw at it.
New Re: The commands are case sensitive
Ok... thanks... I fixed that along with the resolution. (DUH on that..., what I get for being in a Perl World)
New Resolution.
Well damn. I was being to literal, plus I was doing everything... and nothing. Here is what ended up working.

To rewrite this:
http://www.thisdomain.com/site/PageServer?pagename=Urgent_Bloating_Gas

To this:
http://www.somedomain.org/UBG

and to scrub the Query String from the rewrite, causing this:
http://www.somedomain.org/UBG?pagename=Urgent_Bloating_Gas


In the www.thisdomain.com httpd config:
RewriteCond %{QUERY_STRING} pagename=Urgent_Bloating_Gas
RewriteRule ^/site/PageServer http://www.somedomain.org/UBG? [R=301,L]


The Question mark at the end of the destination URL, clears the Query String.
The R=301 makes SEO peeps swoon (Redirect response code 301 and Moved Permanently)
The L means this is the last rule to process if it matches.
New Proof.
In my mind at least, your adventures are proof that rewrite rules are a bandaid on a hack and best avoided if at all possible. :-/

Wade.
Just Add Story http://justaddstory.wordpress.com/
New very useful when an app doesnt have the capabilities
these days an app that doesnt have the capabilities should be ash canned
Any opinions expressed by me are mine alone, posted from my home computer, on my own time as a free American and do not reflect the opinions of any person or company that I have had professional relations with in the past 55 years. meep
New Agreed... but.
Many places just don't have the capital to just replace apps. And need to just make due.
New Its more that...
The organization wanted to get away from the previous application that did the Website for them. Charging US$21,000 per year for an essentially static website...

They are having to support the old website... and point all the "pages in Google" to the proper pages at the new merged site.

They are paying an SEO/Marketing firm a ton of money and they had this arm-lengths long list of *CRITICAL* old URLs that had to be redirected to the proper location.
New I feel your pain.
I've fought SEO URL battles before, too. I've made sure we have URL handling tricks (for database-driven data!) in the app so we don't have to do that sort of shit in rewrite rules.

Wade.
Just Add Story http://justaddstory.wordpress.com/
     Somehow I can't read docs for Apache and RewriteCond/Rule - (folkert) - (12)
         Can't you do a partial match? - (drook)
         Re: Somehow I can't read docs for Apache and RewriteCond/Rul - (boxley) - (2)
             Re: Somehow I can't read docs for Apache and RewriteCond/Rul - (folkert) - (1)
                 email be the url got minged -NT - (boxley)
         The commands are case sensitive - (scoenye) - (1)
             Re: The commands are case sensitive - (folkert)
         Resolution. - (folkert) - (5)
             Proof. - (static) - (4)
                 very useful when an app doesnt have the capabilities - (boxley) - (1)
                     Agreed... but. - (folkert)
                 Its more that... - (folkert) - (1)
                     I feel your pain. - (static)

What's the Queen Koopa like?
89 ms