|
|
|
|
|
|
| Author |
Message |
Boysenberry Payne *nix forums addict
Joined: 07 Feb 2005
Posts: 71
|
Posted: Fri Jul 21, 2006 1:14 pm Post subject:
Re: help with rewrite rule
|
|
|
If I'm not mistaken from an earlier post, you actually want more than to
just have
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
|
Posted: Wed Jul 19, 2006 10:47 pm Post subject:
Re: help with rewrite rule
|
|
|
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
|
Posted: Wed Jul 19, 2006 7:19 pm Post subject:
Re: help with rewrite rule
|
|
|
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:
---------------------------------------------------------------------
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
|
|
| Back to top |
|
 |
Nick Kew *nix forums Guru Wannabe
Joined: 08 Feb 2005
Posts: 299
|
Posted: Tue Jul 18, 2006 10:41 am Post subject:
Re: help with rewrite rule
|
|
|
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
|
Posted: Mon Jul 17, 2006 8:50 pm Post subject:
Re: help with rewrite rule
|
|
|
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
|
Posted: Mon Jul 17, 2006 7:56 pm Post subject:
Re: help with rewrite rule
|
|
|
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
|
Posted: Mon Jul 17, 2006 7:39 pm Post subject:
Re: help with rewrite rule
|
|
|
| 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
|
Posted: Mon Jul 17, 2006 7:24 pm Post subject:
Re: ScriptAlias and Alias Syntax in httpd.conf File
|
|
|
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
|
Posted: Mon Jul 17, 2006 7:17 pm Post subject:
Re: help with rewrite rule
|
|
|
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
|
Posted: Mon Jul 17, 2006 7:16 pm Post subject:
ScriptAlias and Alias Syntax in httpd.conf File
|
|
|
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
|
Posted: Mon Jul 17, 2006 7:13 pm Post subject:
Re: help with rewrite rule
|
|
|
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
|
Posted: Mon Jul 17, 2006 7:04 pm Post subject:
Re: help with rewrite rule
|
|
|
Boysenberry Payne wrote:
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
|
Posted: Mon Jul 17, 2006 6:44 pm Post subject:
Re: help with rewrite rule
|
|
|
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
|
Posted: Mon Jul 17, 2006 6:40 pm Post subject:
help with rewrite rule
|
|
|
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 |
|
 |
|
|
The time now is Fri Nov 21, 2008 9:37 pm | All times are GMT
|
|
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
|
|