httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Norman Peelman" <npeel...@cfl.rr.com>
Subject Re: [users@httpd] Regular expressions in URL rewriting
Date Sun, 12 Oct 2003 23:04:37 GMT
>     I guess it would norm. I knew a HTML page can be treated as a PHP
> aplication, I just didn't know this would also work for Java and Perl, I
> have never worked with those. Anyway, after have been working for three
days
> in it, soon after posting the problem I was able to solve it:
>
> RewriteEngine on
> # The rewritelog was used for debugging, now that it works
> # the loglevel is set to 0 -  no log
> RewriteLog "C:/Programme/Apache Group/Apache2/logs/rewrite.log"
> RewriteLogLevel 0
> # those rewriting rules are used to implement the concept of
> # abstract urls as stated in
> http://philip.greenspun.com/internet-application-workbook/basics
> RewriteCond "C:/Programme/Apache Group/Apache2/htdocs$1" -d   checks if
> there is such a directory
> RewriteRule (.*[^/])$ $1/ [L]    if there is a trailing slash is added,
> RewriteRule (.*[^/])$ $1.php   if not the extension your working is added
>
> This has only been done that way because HTML can be treated as PHP, if I
> used Perl and it required a diffent treatment as to HTML than it would
look
> like this:
>
> RewriteCond "C:/Programme/Apache Group/Apache2/htdocs$1.html" -f   checks
if
> there is such a FILE
> RewriteRule (.*[^/])$ $1.html [L]    if there is .html is added,
>
> RewriteCond "C:/Programme/Apache Group/Apache2/htdocs$1.pl" -f   checks if
> there is such a FILE
> RewriteRule (.*[^/])$ $1.pl [L]    if there is .pl is added
>
> Thanx anyway for the help.
>
>
> ----- Original Message -----
> From: "Norman Peelman" <npeelman@cfl.rr.com>
> To: <users@httpd.apache.org>; "Joao Andrade" <joao66br@yahoo.com.br>
> Sent: Sunday, October 12, 2003 12:03 PM
> Subject: Re: [users@httpd] Regular expressions in URL rewriting
>
> >
> >   Would'nt it be easier to just AddType .htm and .html to whatever
> languages
> > you are using?
> > AddType application/x-httpd-php .php .htm .html
> > AddType application/x-httpd-jsp .jsp .htm .html
> > AddType application/x-httpd-pl .pl .htm .html
> > etc.
> >
> > or would this not work?
> >
> > or at least just assign .htm and .html to the language you are currently
> > using?
> >
> > Norm

   I would guess that assigning .htm and .html to more than one language
would confuse Apache (or at least it would use the first one encountered -
or maybe the last one encountered, in the config file). But I would imagine
it would work on any language.

Norm


---------------------------------------------------------------------
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


Mime
View raw message