httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Muad`dib" <uzul_2...@gmx.net>
Subject Re: [users@httpd] rewrite problem
Date Mon, 03 Feb 2003 08:16:23 GMT
Hi Toni,

ok now it is more clear ....

hmm but still you could use the ScriptAlias directive to solve this problem ( I think/assume
)
I would do the following, maybe it is not the best solution, but at least a workaround :

Add to your httpd.conf something like that                  RedirectMatch (\.pl | \.php) 
http://cgi-server.com/$1  
I don't know if hte regex is right you need to study it but I know you can someretrieve the
requested pl/php script with $... 
Info on that directive can be found here --> http://httpd.apache.org/docs-2.0/mod/mod_alias.html#redirectmatch

Also you could possibly set the DirectoryIndex to index.pl by default and then do the rewriting
through the "referrer-url"

I hope this time it was more helpful and please let me know if it worked like that ...

Paul

----- Original Message ----- 
  From: Toni Maatta 
  To: users@httpd.apache.org 
  Sent: Monday, February 03, 2003 3:55 PM
  Subject: Re: [users@httpd] rewrite problem


  Hi Paul,

  Well.. You understood me wrong, so.. :)

  Let's say I have two machines; www-server, which handles all .html files
  only and cgi-server, which handles all cgi-scripts.

  So I want that www-server handles .html files and cgi-server
  .cgi/.pl/whatever files.

  Now when user uses url http://www.company.com/ I'd like to know what
  document user is trying to access. if it's a index.html I want that my
  www-server handles that request and if it eg. index.cgi I want that my
  www-server rewrites it and redirect it to cgi-server. 

  So I'd like to get document name every time and rewrite it if
  neccessary. I have tried some options, but I haven't been able to get it
  work. in rewrite log there's no document name in input field, when
  accessing "main page".

  I hope you understand my problem now.. ;)

  On Mon, Feb 03, 2003 at 03:45:19PM +0800, Paul Muad`dib wrote:
  > Hi Toni,
  > 
  > first I don't really understand what you want but maybe this will help you :
  > 
  > 1) you don't need to expand an URL
  >  Apache automatically does it for you whenever there is a index.html in the
  > document folder it will autmatically show it.
  >  If you want to have to show an index.php instead of index.html you need to
  > set that in your httpd.conf :
  >  DirectoryIndex index.php index.html
  >  --> this means apache first will try to call index.php if it doesn't exist
  > it will show index.html
  > 
  > 2) Redirecting pl/php scripts
  > There is an existing Directive for it ( you can find in the documentation
  > for further information ), I think you look for that :
  > AddHandler perl .pl
  > AddHandler php .php
  > Of course this means you need to include the according modules and also the
  > ScriptAlias directive but you can find enough information about that in the
  > www and also on the documentation on http://httpd.apache.org/docs-2.0.
  > 
  > I hope it was helpful and btw RTFM ;-)
  > 
  > Paul
  > 
  > 
  > ----- Original Message -----
  > From: Toni Maatta
  > To: users@httpd.apache.org
  > Sent: Monday, February 03, 2003 3:11 PM
  > Subject: [users@httpd] rewrite problem
  > 
  > 
  > Hi,
  > 
  > How can I expand url http://www.company.com/ to
  > http://www.company.com/index.xxx
  > 
  > I'd like to know whenever user request any .php/.pl/or so documents and
  > redirect all scripts to cgi-servers. But the problem is that I don't
  > know how can I match eg. .php, when there are no document name in url.
  > 
  > Any ideas?
  > 
  > -- toni
  > 
  > ---------------------------------------------------------------------
  > 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
  > 
  > 
  > ---------------------------------------------------------------------
  > 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
  > 

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