httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben-Nes Michael" <m...@canaan.co.il>
Subject Re: [users@httpd] rewrite url on the fly
Date Thu, 15 Jul 2004 14:26:46 GMT
snip from mod_rewrite:
------------
Environment Variables
This module keeps track of two additional (non-standard) CGI/SSI environment
variables named SCRIPT_URL and SCRIPT_URI. These contain the logical
Web-view to the current resource, while the standard CGI/SSI variables
SCRIPT_NAME and SCRIPT_FILENAME contain the physical System-view.

Notice: These variables hold the URI/URL as they were initially requested,
i.e., before any rewriting. This is important because the rewriting process
is primarily used to rewrite logical URLs to physical pathnames.

Example:

SCRIPT_NAME=/sw/lib/w3s/tree/global/u/rse/.www/index.html
SCRIPT_FILENAME=/u/rse/.www/index.html
SCRIPT_URL=/u/rse/
SCRIPT_URI=http://en1.engelschall.com/u/rse/
-------------

Can I use SCRIPT_URI to logicaly test if im coming from
https://secure.mysite.com/customer-site which will change /images to
/customer-sites/images
and
https://secure.mysite.com/customer-site2 which will change /images to
/customer-sites2/images

cheers

----- Original Message ----- 
From: "David Neu" <david@netwerx.de>
To: <users@httpd.apache.org>
Sent: Thursday, July 15, 2004 4:54 PM
Subject: Re: [users@httpd] rewrite url on the fly


> Hi,
> use relative links!
> you cannot rewrite this on 'on the fly' if you have more than one
customer.
> if customer1 has an link that points to /images/test.gif and customer2
> has an link that points to /images/someimge.jpg how should apache decide
> if the request should be rewritten to /customer1/images or
/customer2/images
>
> David
>
>
> Ben-Nes Michael wrote:
> > Hi All
> >
> > here is my problem:
> >
> > I have a virtual host for www.customer-site.com
> > <http://www.customer-site.com>
> > All the data is under /var/httpd/customer-site.com/www/html directory
> >
> > I supply SSL security for this site under diffrent virtual server ( ack
> > secure.mysite.com )
> >
> > the problem is that secure.mysite.com give solution to many web sites so
> > a typical directory is:
> >
> > Alias /customer-site /var/httpd/customer-site.com/www/html
> >
> > <Directory "/var/httpd/customer-site.com/www/html">
> >   Options Includes FollowSymLinks
> >   AllowOverride None
> >   order allow,deny
> >   Allow from all
> > </Directory>
> >
> > now when i write:
> > https://secure.mysite.com/customer-site
> > its lead to the same directory as
> > http://www.customer-site.com <http://www.customer-site.com>
> >
> > The problem start when the html code has <image
> > src="/images/an-image.jpg" />
> > this is will result as a broken image under the secure directory as
> > images directory will be under /customer-site and not under /
> >
> > is there a way to fix such problem ? replacing "/" with "/customer-site"
> > on the fly ?
> >
> > I played alittle with mod_rewrite but im not sure its capable of doing
this
> >
> > Thanks fin advance
> >
--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
Fax: 972-4-6990098
http://www.canaan.net.il
--------------------------



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