You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Wagner, Aaron" <aa...@bankofamerica.com> on 2004/08/31 21:13:00 UTC

[users@httpd] rewrite rule to spawn new window for a specific link pattern

Server Version: Apache/2.0.48 (Win32) mod_perl/1.99_13-dev Perl/v5.8.3 PHP/4.3.4 
Server Built: Nov 2 2003 23:31:38 
on Win2k
----------------------------
I need a Rewrite rule to spawn new window for a specific link pattern...if that's possible

If have this link and the perameters change;
<a href="/Tools/_CallFlows/CallFlowMain.php?seqnum=1&MasterName=EWAA_Application">

I know that I can write a rule to find the link;
RewriteRule(/Tools/_CallFlows/CallFlowMain.php.*) $1 [R]

but I need to append a 'target="_blank"' to the link to spawn a new window.

I've tried 
ReWriteRule (/Tools/_pagingform/pagingform.php?test=test) $1 target="_blank" [R]
and get an error on restart of apache--
>>>The Apache service named  reported the following error:
>>> RewriteRule: bad flag delimiters     . 

Any help is appreciated

aaron

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rewrite rule to spawn new window for a specific link pattern

Posted by Robert Andersson <ro...@profundis.nu>.
Wagner, Aaron wrote:
> I know that I can write a rule to find the link;
> RewriteRule(/Tools/_CallFlows/CallFlowMain.php.*) $1 [R]
>
> but I need to append a 'target="_blank"' to the link to spawn a
> new window.

As already stated, this is not possible to do from the server side.

You might also want to question why you need to open a new window anyway.
Typically, when I click a link that pops up a new window without me asking
for it, I feel like hitting someone in the face, hard.

There is a good reason why <a href="..." target="_blank"> isn't valid XHTML.

[/rant]

Regards,
Robert Andersson


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rewrite rule to spawn new window for a specific link pattern

Posted by Joshua Slive <js...@gmail.com>.
On Tue, 31 Aug 2004 15:13:00 -0400, Wagner, Aaron
<aa...@bankofamerica.com> wrote:
> I need a Rewrite rule to spawn new window for a specific link pattern...if that's possible

> but I need to append a 'target="_blank"' to the link to spawn a new window.
> 
> I've tried
> ReWriteRule (/Tools/_pagingform/pagingform.php?test=test) $1 target="_blank" [R]
> and get an error on restart of apache--
> >>>The Apache service named  reported the following error:
> >>> RewriteRule: bad flag delimiters     .

No, I don't believe this is directly possible.  Apache can only send
URLs in a redirect.  It can't send other parameters like you would
include in an html <a> link.

People usually handle this type of problem with javascript.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


AW: [users@httpd] rewrite rule to spawn new window for a specific link pattern

Posted by Steffen Heil <li...@steffen-heil.de>.
Hi

> but I need to append a 'target="_blank"' to the link to spawn a new
window.

no, this is wrong.

You would need to rewrite every link in the apge to contain that part, not
the urls. See:

<a href='test.htm'>
needs to become:
<a href='test.htm' target="_blank">

Your suggestion is:

<a href='test.htm target="_blank"'>

And this would NOT work.

Maybe you can really rewrite the html files that contain these links, when
they are served, but at that point, when you try to step in, it is already
too late.

Regards,
  Steffen


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org