Something like
RewriteRule (.*).php(.*)$ $1.php?login=%{HTTP:Authorization}&$2
May do it.
The parenthesis group patterns for re-use, but work in increasing numerical
order. (Make sense?)
'.' means any character (except for newline), '*' means 0 or more occurences
of the preceding
the '$' in "(.*).php(.*)$ matches end-of-line (should help keep all your
extra variables and store them in $2.
Thanks,
Warren "Tray" Torrance
On Mon, Jan 4, 2010 at 16:07, <[email protected]> wrote:
> Message: 2
> Date: Mon, 4 Jan 2010 14:39:28 -0600
> From: "Mark A. Lappin" <[email protected]>
> Subject: [brlug-general] Apache mod_rewrite rule assistance
> To: "[email protected]" <[email protected]>
> Message-ID:
> <[email protected]>
> Content-Type: text/plain; charset="us-ascii"
>
> Howdy All -
>
> Hoping somebody can help me out. I'm working in a shared hosting
> environment and having to get mildly creative getting the name of my
> .htaccess authenticated user. Finally after much google searching and
> fiddling in PHP and .htaccess, I seem to finally be able to get this through
> the following mod_rewrite segment:
>
> <IfModule mod_rewrite.c>
> RewriteEngine on
> RewriteCond %{HTTP:Authorization} !^$
> RewriteRule test.php$ test.php?login=%{HTTP:Authorization}
>
> </IfModule>
>
>
> Ok, that's all well, fine and dandy...and it works well enough, but I'm not
> 1) A mod_rewrite guru
> 2) A regular expressions master (as much as I need to be, they've never
> quite clicked for me).
>
> I need/would like some assistance in transforming the above Rewriterule to
> work for every .php file in the protected directory/structure.
>
> Suggestions????
>
> Mark (this isn't for LMFJ, its actually for CCCC, just using my work e-mail
> to ask the question)
>
> Mark
> AIM: MarkAtLMFJ
>
>
> Mark A. Lappin, CCNA, MCITP: Enterprise Administrator | Lee Michaels Fine
> Jewelry
> Director of Information Technology
> 11314 Cloverland Ave | Baton Rouge, LA 70809
> Ph: 225.291.9094 ext 245 | Fax: 225-291-5778 | Mobile: 225-362-2770
> www.lmfj.com
>
>
>
> This communication is privileged and confidential. If you are not the
> intended recipient, please notify the sender by reply e-mail and destroy all
> copies of this communication .
>
_______________________________________________
General mailing list
[email protected]
http://mail.brlug.net/mailman/listinfo/general_brlug.net