[wplug] httpd rewrite help

Chris Romano romano.chris at gmail.com
Thu Aug 28 08:11:47 EDT 2008


On Thu, Aug 28, 2008 at 4:29 AM, Alexandros Papadopoulos
<apapadop at alumni.cmu.edu> wrote:
> On Wed, Aug 27, 2008 at 7:26 PM, Chris Romano <romano.chris at gmail.com> wrote:
>> I'm trying to write a RewriteRule but I'm not very get with regex.
>>
>> I'm trying to turn this link:
>> www.example.com/a/k=VALUE1&u=VALUE2
>>
>> into this:
>> www.example.com/a/index.php?k=VALUE1&u=VALUE2
>>
>> I've tried the following two rules and they don't work.  I'm just
>> having a hard time find clear howtos on this.
>> RewriteRule ^a/([^/]+)?$ a/index.php?$1 [L]
>> RewriteRule   ^a/([A-Za-z0-9-]+)/([0-9]+)?$ a/index.php?k=$1&u=$2 [L]
>
> <snip>
>
> Not a direct answer, but have a look at
> http://forum.modrewrite.com/viewforum.php?f=3 - an excellent resource
> when it comes to rewriting URLs with Apache.
>

I was missing a flag.  Thanks to Alexandros for that link (it's bookmarked now)
The correct syntax is:
RewriteRule ^a/([^/]+)?$ a/index.php?$1 [QSA,L]

Thanks everyone

-- 
"They that would trade essential liberty for a little temporary safety
deserve neither." -- Benjamin Franklin


More information about the wplug mailing list