mod_rewrite [E] question

mod_rewrite [E] question

Post by Jim Kiss » Sun, 13 Dec 1998 04:00:00



If my usr is
http://some-domain.com/some_directory/LDIR=foobar/my_html.shtml
and I have a rewrite rule
RewriteRule ^(.*)/LDIR=([^/]+)/(.*)  $1/$3 [E=LDIR:$2]
<!--#printenv -->
will show LDIR=foobar

but if my url is

http://some-domain.com/
and my rewrite rule is:
RewriteRule ^/$ $1 [E=LDIR:$1]
#printenv shows
REDIREDT_LDIR=/
and not
LDIR=/

jlk Consultants ltd.
jlk "at" pobox "dot" com  // just to keep the spam away
Home of the Apache RTFM! http://www.jlk.net/apache/

 
 
 

mod_rewrite [E] question

Post by Ralf S. Engelschal » Fri, 22 Jan 1999 04:00:00



Quote:> If my usr is
> http://some-domain.com/some_directory/LDIR=foobar/my_html.shtml
> and I have a rewrite rule
> RewriteRule ^(.*)/LDIR=([^/]+)/(.*)  $1/$3 [E=LDIR:$2]
> <!--#printenv -->
> will show LDIR=foobar
> but if my url is
> http://some-domain.com/
> and my rewrite rule is:
> RewriteRule ^/$ $1 [E=LDIR:$1]
> #printenv shows
> REDIREDT_LDIR=/
> and not
> LDIR=/

Although ``RewriteRule ^/$ $1 [E=LDIR:$1]'' cannot work, your problem in
general is that for things like http://some-domain.com/ Apache does internal
sub-requests to find for instance http://some-domain.com/index.html.  And this
is the reason why you get REDIRECT_LDIR.

                                       Ralf S. Engelschall

                                       www.engelschall.com

 
 
 

1. mod_rewrite question

let's say I want:

1)http://www.domain.com ->http://www.newdomain.com/cgi-bin/script.pl?s=1
2)http://domain.com -> http://www.newdomain.com/cgi-bin/script.pl?s=1
3)http://www.domain.com/blah/blah/whatever.cgi?blah=blah&... ->
     http://www.newdomain.com/cgi-bin/script.pl?s=1

Basically all requests for a domain go to the same place....Please
help!!!

The way I do it now, only works partially (satisfies 1&2 above):

RewriteCond %{HTTP_HOST} domain [NC]
RewriteRule ^/$ http://www.newdomain.com/cgi-bin/script.pl?s=1

Please Help!

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

2. Looking for a DEC Alpha motherboard

3. Help: mod_rewrite inherit question

4. Reviews requested for Solaris 2.X Internals (SP-365)

5. mod_rewrite question

6. cannot access mail server, rest of net OK

7. Question about Virtual-Domains, mod_rewrite, and CGI

8. Making LILO graphical might make Linux nicer to use

9. mod_rewrite question

10. mod_rewrite/.htaccess question

11. mod_rewrite question: .fcgi -> .cgi

12. Apache mod_rewrite question

13. mod_rewrite question