niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Apps » Apache
help with rewrite rule
Post new topic   Reply to topic Page 1 of 1 [15 Posts] View previous topic :: View next topic
Author Message
Boysenberry Payne
*nix forums addict


Joined: 07 Feb 2005
Posts: 71

PostPosted: Fri Jul 21, 2006 1:14 pm    Post subject: Re: help with rewrite rule Reply with quote

If I'm not mistaken from an earlier post, you actually want more than to
just have

Quote:
http://cfdev.cota.csulb.edu/cota

or

http://cfdev.cota.csulb.edu/cota/

work. You want to also use the same rewrite for images, etc.
Without knowing the full extent of what you expect the code
to do I don't even know if mod_rewrite is right for the job.

To me it sounds like you might need some server-side technology like
php or perl
to do some URL processing and redirects...

Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Jul 19, 2006, at 5:47 PM, Mike Soultanian wrote:

Quote:
Well, for example, I would like to be able to input either of the
following into my browser:

http://cfdev.cota.csulb.edu/cota

or

http://cfdev.cota.csulb.edu/cota/

and the web page will be displayed while the application server
handling the requests all see localhost as the originating address.

My apologies for not being more clear. cota is a folder, and the
problem is that it's not appending the trailing slash.

thanks!
mike


Boysenberry Payne wrote:
That's why I was saying you'd probably have to write something a
little complicated.
Its really hard if you don't already have a naming convention in mind.
That way you could just force it to rewrite without the ending slash
if you wanted.
I think its adding the trailing slash because it assumes cota is a
directory.
(Someone else on here might have a better explanation.)
What exactly are you trying to see happen, in human terms, i.e. how
would
you like the request to unfold.
Thanks,
Boysenberry

---------------------------------------------------------------------
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
Back to top
Mike Soultanian
*nix forums beginner


Joined: 17 Jul 2006
Posts: 7

PostPosted: Wed Jul 19, 2006 10:47 pm    Post subject: Re: help with rewrite rule Reply with quote

Well, for example, I would like to be able to input either of the
following into my browser:

http://cfdev.cota.csulb.edu/cota

or

http://cfdev.cota.csulb.edu/cota/

and the web page will be displayed while the application server handling
the requests all see localhost as the originating address.

My apologies for not being more clear. cota is a folder, and the
problem is that it's not appending the trailing slash.

thanks!
mike


Boysenberry Payne wrote:
Quote:
That's why I was saying you'd probably have to write something a little
complicated.

Its really hard if you don't already have a naming convention in mind.
That way you could just force it to rewrite without the ending slash if
you wanted.
I think its adding the trailing slash because it assumes cota is a
directory.
(Someone else on here might have a better explanation.)

What exactly are you trying to see happen, in human terms, i.e. how would
you like the request to unfold.


Thanks,
Boysenberry


---------------------------------------------------------------------
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
Back to top
Boysenberry Payne
*nix forums addict


Joined: 07 Feb 2005
Posts: 71

PostPosted: Wed Jul 19, 2006 7:19 pm    Post subject: Re: help with rewrite rule Reply with quote

That's why I was saying you'd probably have to write something a little
complicated.

Its really hard if you don't already have a naming convention in mind.
That way you could just force it to rewrite without the ending slash if
you wanted.
I think its adding the trailing slash because it assumes cota is a
directory.
(Someone else on here might have a better explanation.)

What exactly are you trying to see happen, in human terms, i.e. how
would
you like the request to unfold.


Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Jul 19, 2006, at 2:09 PM, Mike Soultanian wrote:

Quote:
Hey Pid,
I gave this a try:

RewriteRule /(.*)(/)?$ http://localhost:81/$1$2 [P]

and it's still converting:

http://cfdev.cota.csulb.edu/cota

to

http://localhost:81/cota/

instead of:

http://cfdev.cota.csulb.edu/cota/

Any ideas?

thanks,
Mike

Pid wrote:
RewriteRule /(.*)(/)?$ http://localhost:81/$1$2
you need the second dollar variable to pick up the second pair of
brackets, instead of always appending a slash.
Mike Soultanian wrote:
Boysenberry Payne wrote:
How about adding this:

RewriteRule /(.*)(/)?$ http://localhost:81/$1/ [P]

That almost worked!

That's interesting because it gets me through to the page, but still
leaves off the trailing slash. That in turn breaks the relative
links
which are looking for the trailing slash as can be seen here (I just
set
up a dns entry for my server):

http://cfdev.cota.csulb.edu/cota

whereas if you put the trailing slash, the trailing slash is getting
appended to everything and seems to break other things on the site
such
as images. When trying to view:

http://cfdev.cota.csulb.edu/cota/layouts/images/about/about-
banner.jpg

I'll get the following error:

The requested URL /cota/layouts/images/about/about-banner.jpg/ was
not
found on this server.

Any ideas?

Thanks!
MIke

---------------------------------------------------------------------
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
Back to top
Mike Soultanian
*nix forums beginner


Joined: 17 Jul 2006
Posts: 7

PostPosted: Wed Jul 19, 2006 7:09 pm    Post subject: Re: help with rewrite rule Reply with quote

Hey Pid,
I gave this a try:

RewriteRule /(.*)(/)?$ http://localhost:81/$1$2 [P]

and it's still converting:

http://cfdev.cota.csulb.edu/cota

to

http://localhost:81/cota/

instead of:

http://cfdev.cota.csulb.edu/cota/

Any ideas?

thanks,
Mike

Pid wrote:
Quote:
RewriteRule /(.*)(/)?$ http://localhost:81/$1$2

you need the second dollar variable to pick up the second pair of
brackets, instead of always appending a slash.


Mike Soultanian wrote:
Boysenberry Payne wrote:
How about adding this:

RewriteRule /(.*)(/)?$ http://localhost:81/$1/ [P]

That almost worked!

That's interesting because it gets me through to the page, but still
leaves off the trailing slash. That in turn breaks the relative links
which are looking for the trailing slash as can be seen here (I just set
up a dns entry for my server):

http://cfdev.cota.csulb.edu/cota

whereas if you put the trailing slash, the trailing slash is getting
appended to everything and seems to break other things on the site such
as images. When trying to view:

http://cfdev.cota.csulb.edu/cota/layouts/images/about/about-banner.jpg

I'll get the following error:

The requested URL /cota/layouts/images/about/about-banner.jpg/ was not
found on this server.

Any ideas?

Thanks!
MIke

---------------------------------------------------------------------
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
Back to top
Nick Kew
*nix forums Guru Wannabe


Joined: 08 Feb 2005
Posts: 299

PostPosted: Tue Jul 18, 2006 10:41 am    Post subject: Re: help with rewrite rule Reply with quote

On Monday 17 July 2006 19:40, Mike Soultanian wrote:
Quote:
Hello,
We have to proxy our requests on our web server but we're running into
some problems.

[ much discussion of over-complicated methods ensued, amongst which
I see just one post mentioning at the simple and effective solution ]

http://www.apacheweek.com/features/reverseproxies

--
Nick Kew

---------------------------------------------------------------------
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
Back to top
Pid
*nix forums beginner


Joined: 19 Jun 2006
Posts: 32

PostPosted: Mon Jul 17, 2006 8:50 pm    Post subject: Re: help with rewrite rule Reply with quote

RewriteRule /(.*)(/)?$ http://localhost:81/$1$2

you need the second dollar variable to pick up the second pair of
brackets, instead of always appending a slash.


Mike Soultanian wrote:
Quote:
Boysenberry Payne wrote:
How about adding this:

RewriteRule /(.*)(/)?$ http://localhost:81/$1/ [P]


That almost worked!

That's interesting because it gets me through to the page, but still
leaves off the trailing slash. That in turn breaks the relative links
which are looking for the trailing slash as can be seen here (I just set
up a dns entry for my server):

http://cfdev.cota.csulb.edu/cota

whereas if you put the trailing slash, the trailing slash is getting
appended to everything and seems to break other things on the site such
as images. When trying to view:

http://cfdev.cota.csulb.edu/cota/layouts/images/about/about-banner.jpg

I'll get the following error:

The requested URL /cota/layouts/images/about/about-banner.jpg/ was not
found on this server.

Any ideas?

Thanks!
MIke

---------------------------------------------------------------------
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
Back to top
Mike Soultanian
*nix forums beginner


Joined: 17 Jul 2006
Posts: 7

PostPosted: Mon Jul 17, 2006 7:56 pm    Post subject: Re: help with rewrite rule Reply with quote

You know, I'm guessing that I'm getting that proxy loop error because
the proxy is listening on both ports 80 and 81 (I have a virtual host on
81)? Just a guess....

mike

Mike Soultanian wrote:
Quote:
See the ProxyPassReverse directive, whose job it is to correct
trailing-slash redirects.
(Hint: You don't even need RewriteRule for this. ProxyPass will do
fine.)

Joshua.

Hey Joshua,
For kicks I tried ProxyPass (I really have no idea what I'm doing) using
the following:

proxyrequests off
ProxyPass /foobarfoobar http://localhost:81/

and it worked perfectly. At first I tried:

ProxyPass / http://localhost:81/

which resulted in:

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /cota/index.cfm.

Reason: Max-Forwards has reached zero - proxy loop?

So, then I tried:

ProxyPass /cota http://localhost:81/

but then I couldn't access the folder /cota; I didn't even see it in the
webroot folder listing. So, then I tried the following:

ProxyPass /foobarfoobar http://localhost:81/

and it works great! I tried /foobarfoobar because I noticed when I had
/cota, everything except for /cota worked fine. Is there a cleaner way
to use this mod? If not, I'm still a very happy camper!!

Thanks,
Mike

---------------------------------------------------------------------
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
Back to top
Mike Soultanian
*nix forums beginner


Joined: 17 Jul 2006
Posts: 7

PostPosted: Mon Jul 17, 2006 7:39 pm    Post subject: Re: help with rewrite rule Reply with quote

Quote:
See the ProxyPassReverse directive, whose job it is to correct
trailing-slash redirects.
(Hint: You don't even need RewriteRule for this. ProxyPass will do fine.)

Joshua.

Hey Joshua,
For kicks I tried ProxyPass (I really have no idea what I'm doing) using
the following:

proxyrequests off
ProxyPass /foobarfoobar http://localhost:81/

and it worked perfectly. At first I tried:

ProxyPass / http://localhost:81/

which resulted in:

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /cota/index.cfm.

Reason: Max-Forwards has reached zero - proxy loop?

So, then I tried:

ProxyPass /cota http://localhost:81/

but then I couldn't access the folder /cota; I didn't even see it in the
webroot folder listing. So, then I tried the following:

ProxyPass /foobarfoobar http://localhost:81/

and it works great! I tried /foobarfoobar because I noticed when I had
/cota, everything except for /cota worked fine. Is there a cleaner way
to use this mod? If not, I'm still a very happy camper!!

Thanks,
Mike

---------------------------------------------------------------------
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
Back to top
Jesse Ross
*nix forums beginner


Joined: 12 Jun 2006
Posts: 7

PostPosted: Mon Jul 17, 2006 7:24 pm    Post subject: Re: ScriptAlias and Alias Syntax in httpd.conf File Reply with quote

Hello Ki Song,

You need a separate Alias line for every Alias directive. So this would
look something like

Alias /foo /usr/local/foo/htdocs
Alias /bar /usr/local/bar/htdocs

Note that there's nothing quite like a "fake address" or "real address"
here. The purpose of Alias directives is to map part of your URL space
to part of your filesystem (and the same is true for ScriptAliases). If
you're looking to map part of your URL space to another URL, you might
want to look into a Redirect.

Please check out the documentation for these directives (here it is for
apache 1.3: http://httpd.apache.org/docs/1.3/mod/mod_alias.html#alias).
If you're still having a problem, make sure to tell us which version
of apache you're using, and include relevant information from your error
log.

take care,
Jesse Ross


Ki Song wrote:
Quote:
I have a quick question.
If I want to define multiple ScriptAlias and Alias directories in the
httpd.conf file, what is the syntax?

I've tried it this way:

ScriptAlias fakeaddress1 realaddress1,
fakeaddress2 realaddress2,
fakeaddress3 realaddress3

Alias fakeaddress1 realaddress1,
fakeaddress2 realaddress2,
fakeaddress3 realaddress3

and this way:

ScriptAlias fakeaddress1 realaddress1
ScriptAlias fakeaddress2 realaddress2

Alias fakeaddress1 realaddress1
Alias fakeaddress2 realaddress2


Neither seems to work.



---------------------------------------------------------------------
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
Back to top
Boysenberry Payne
*nix forums addict


Joined: 07 Feb 2005
Posts: 71

PostPosted: Mon Jul 17, 2006 7:17 pm    Post subject: Re: help with rewrite rule Reply with quote

Sounds you might need something a little more complicated.

For example:

RewriteRule ^(.*)habitat/(.*)$
http://localhost:81/pro/habitat.pl?account=data=$2 [P]

Allowing me to read the whole url then process it.

Otherwise you might want to rewrite for different directories, i.e.
taking care of images
and the like.

Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Jul 17, 2006, at 2:04 PM, Mike Soultanian wrote:

Quote:
Boysenberry Payne wrote:
How about adding this:

RewriteRule /(.*)(/)?$ http://localhost:81/$1/ [P]


That almost worked!

That's interesting because it gets me through to the page, but still
leaves off the trailing slash. That in turn breaks the relative links
which are looking for the trailing slash as can be seen here (I just
set up a dns entry for my server):

http://cfdev.cota.csulb.edu/cota

whereas if you put the trailing slash, the trailing slash is getting
appended to everything and seems to break other things on the site
such as images. When trying to view:

http://cfdev.cota.csulb.edu/cota/layouts/images/about/about-banner.jpg

I'll get the following error:

The requested URL /cota/layouts/images/about/about-banner.jpg/ was not
found on this server.

Any ideas?

Thanks!
MIke

---------------------------------------------------------------------
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
Back to top
Ki Song
*nix forums beginner


Joined: 28 Feb 2006
Posts: 16

PostPosted: Mon Jul 17, 2006 7:16 pm    Post subject: ScriptAlias and Alias Syntax in httpd.conf File Reply with quote

I have a quick question.
If I want to define multiple ScriptAlias and Alias directories in the
httpd.conf file, what is the syntax?

I've tried it this way:

ScriptAlias fakeaddress1 realaddress1,
fakeaddress2 realaddress2,
fakeaddress3 realaddress3

Alias fakeaddress1 realaddress1,
fakeaddress2 realaddress2,
fakeaddress3 realaddress3

and this way:

ScriptAlias fakeaddress1 realaddress1
ScriptAlias fakeaddress2 realaddress2

Alias fakeaddress1 realaddress1
Alias fakeaddress2 realaddress2


Neither seems to work.



---------------------------------------------------------------------
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
Back to top
Joshua Slive
*nix forums Guru


Joined: 07 Feb 2005
Posts: 1647

PostPosted: Mon Jul 17, 2006 7:13 pm    Post subject: Re: help with rewrite rule Reply with quote

On 7/17/06, Mike Soultanian <msoultan@csulb.edu> wrote:
Quote:
Hello,
We have to proxy our requests on our web server but we're running into
some problems. I'm having a problem with the following rewrite rule:

RewriteRule /(.*) http://localhost:81/$1 [P]

If I do not specify the trailing slash when using a folder name, I get
an error.

See the ProxyPassReverse directive, whose job it is to correct
trailing-slash redirects.
(Hint: You don't even need RewriteRule for this. ProxyPass will do fine.)

Joshua.

---------------------------------------------------------------------
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
Back to top
Mike Soultanian
*nix forums beginner


Joined: 17 Jul 2006
Posts: 7

PostPosted: Mon Jul 17, 2006 7:04 pm    Post subject: Re: help with rewrite rule Reply with quote

Boysenberry Payne wrote:
Quote:
How about adding this:

RewriteRule /(.*)(/)?$ http://localhost:81/$1/ [P]


That almost worked!

That's interesting because it gets me through to the page, but still
leaves off the trailing slash. That in turn breaks the relative links
which are looking for the trailing slash as can be seen here (I just set
up a dns entry for my server):

http://cfdev.cota.csulb.edu/cota

whereas if you put the trailing slash, the trailing slash is getting
appended to everything and seems to break other things on the site such
as images. When trying to view:

http://cfdev.cota.csulb.edu/cota/layouts/images/about/about-banner.jpg

I'll get the following error:

The requested URL /cota/layouts/images/about/about-banner.jpg/ was not
found on this server.

Any ideas?

Thanks!
MIke

---------------------------------------------------------------------
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
Back to top
Boysenberry Payne
*nix forums addict


Joined: 07 Feb 2005
Posts: 71

PostPosted: Mon Jul 17, 2006 6:44 pm    Post subject: Re: help with rewrite rule Reply with quote

How about adding this:

RewriteRule /(.*)(/)?$ http://localhost:81/$1/ [P]


Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Jul 17, 2006, at 1:40 PM, Mike Soultanian wrote:

Quote:
Hello,
We have to proxy our requests on our web server but we're running into
some problems. I'm having a problem with the following rewrite rule:

RewriteRule /(.*) http://localhost:81/$1 [P]

If I do not specify the trailing slash when using a folder name, I get
an error. So, for example, if I go here:

http://134.139.143.27/kcty/

it works fine. However, if I use the following:

http://134.139.143.27/kcty

it forwards my browser here:

http://localhost:81/kcty/

which is incorrect. Does anyone know how I can update the rule so
that it will correctly put the trailing slash back on the url when a
folder is specified?

Thanks!
Mike

---------------------------------------------------------------------
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
Back to top
Mike Soultanian
*nix forums beginner


Joined: 17 Jul 2006
Posts: 7

PostPosted: Mon Jul 17, 2006 6:40 pm    Post subject: help with rewrite rule Reply with quote

Hello,
We have to proxy our requests on our web server but we're running into
some problems. I'm having a problem with the following rewrite rule:

RewriteRule /(.*) http://localhost:81/$1 [P]

If I do not specify the trailing slash when using a folder name, I get
an error. So, for example, if I go here:

http://134.139.143.27/kcty/

it works fine. However, if I use the following:

http://134.139.143.27/kcty

it forwards my browser here:

http://localhost:81/kcty/

which is incorrect. Does anyone know how I can update the rule so that
it will correctly put the trailing slash back on the url when a folder
is specified?

Thanks!
Mike

---------------------------------------------------------------------
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
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [15 Posts] View previous topic :: View next topic
The time now is Fri Nov 21, 2008 9:37 pm | All times are GMT
navigation Forum index » Apps » Apache
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts rewrite env_from witch original h_to? Daniel Müller Exim 0 Thu Jul 20, 2006 10:21 am
No new posts making the proxy and/or rewrite mods respond to a particu... Mike Soultanian Apache 1 Tue Jul 18, 2006 9:46 pm
No new posts ON INSERT view rule Anthony Chavez PostgreSQL 0 Wed Jul 12, 2006 4:26 pm
No new posts Applying a universal rewrite Andrew Clarke Apache 1 Mon Jul 10, 2006 1:31 am
No new posts Applying a universal rewrite Andrew Clarke Apache 2 Mon Jul 10, 2006 1:17 am

Credit Counseling | Mortgage Calculator | Nationwide Building Society | Loans | Property Search
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.3791s ][ Queries: 20 (0.2029s) ][ GZIP on - Debug on ]