Thread mod_rewrite und beliebig lange URL's (19 answers)
Opened by jan10001 at 2004-04-25 16:48

Strat
 2004-04-26 02:45
#30724 #30724
User since
2003-08-04
5246 Artikel
ModeratorIn
[Homepage] [default_avatar]
nebenbei: wenn man mod_perl verwendet, kann man auch einen PerlTransHandler verwenden; der kann noch mehr als mod_perl, z.B.
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package TransHandler;
use warnings;
use strict;

use Apache::Constants qw(DECLINED);

# this is a replacement for mod_rewrite to get more pretty URIs
#------------------------------------------------------------
sub handler {
   my $r = shift;
   my $standardUri = "/pboard//PBoard.pm";

   my $uri = $r->uri();

   if ( $uri =~ m|^/$| or $uri =~ m|^/overview/?| ) {
       $r->uri($standardUri);
       $r->args("action=overview");
       return DECLINED;
   } # if
   elsif ($uri =~ m|^/logon|) {
       $r->uri($standardUri);
       $r->args("action=logon");
return DECLINED;
   } # elsif
# ...
   return DECLINED;
} # handler
#------------------------------------------------------------
1; # modules have to return a true value
\n\n

<!--EDIT|Strat|1082980351-->
perl -le "s::*erlco'unaty.'.dk':e,y;*kn:ai;penmic;;print"
http://www.fabiani.net/

View full thread mod_rewrite und beliebig lange URL's