You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mike Soultanian <ms...@csulb.edu> on 2006/07/17 20:40:08 UTC
[users@httpd] 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
Re: [users@httpd] help with rewrite rule
Posted by Nick Kew <ni...@webthing.com>.
On Monday 17 July 2006 19:40, Mike Soultanian wrote:
> 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
Re: [users@httpd] help with rewrite rule
Posted by Mike Soultanian <ms...@csulb.edu>.
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:
>> 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
Re: [users@httpd] help with rewrite rule
Posted by Mike Soultanian <ms...@csulb.edu>.
> 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
Re: [users@httpd] help with rewrite rule
Posted by Joshua Slive <jo...@slive.ca>.
On 7/17/06, Mike Soultanian <ms...@csulb.edu> wrote:
> 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
Re: [users@httpd] help with rewrite rule
Posted by Boysenberry Payne <bo...@humaniteque.com>.
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:
> 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
Re: [users@httpd] help with rewrite rule - SOLVED!
Posted by Mike Soultanian <ms...@csulb.edu>.
I'm still kinda shocked that I got it working, but I actually does what
I wanted!
I was messing around with this, and I have to admit that it was more
trial and error than knowledge, but I got it:
RewriteCond %{SCRIPT_FILENAME} /$
RewriteRule /(.*) http://localhost:81/$1/ [P]
I'm kinda proud that I figured out the /$ (that itself took me a half
hour to figure out!). I totally suck at regular expressions, and you
know, I still don't understand why the above works, but it does!
now both of the following work:
http://cfdev.cota.csulb.edu/cota
http://cfdev.cota.csulb.edu/cota/
Thanks for all the help!
Mike
Boysenberry Payne wrote:
> If I'm not mistaken from an earlier post, you actually want more than to
> just have
>
>> 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:
>
>> 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
---------------------------------------------------------------------
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
Re: [users@httpd] help with rewrite rule
Posted by Boysenberry Payne <bo...@humaniteque.com>.
If I'm not mistaken from an earlier post, you actually want more than to
just have
> 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:
> 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
Re: [users@httpd] help with rewrite rule
Posted by Mike Soultanian <ms...@csulb.edu>.
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
Re: [users@httpd] help with rewrite rule
Posted by Boysenberry Payne <bo...@humaniteque.com>.
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:
> 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
Re: [users@httpd] help with rewrite rule
Posted by Mike Soultanian <ms...@csulb.edu>.
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
Re: [users@httpd] help with rewrite rule
Posted by Pid <p...@pidster.com>.
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
Re: [users@httpd] ScriptAlias and Alias Syntax in httpd.conf File
Posted by Jesse Ross <jr...@broad.mit.edu>.
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:
> 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
[users@httpd] ScriptAlias and Alias Syntax in httpd.conf File
Posted by Ki Song <ki...@knifecenter.com>.
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
Re: [users@httpd] help with rewrite rule
Posted by Mike Soultanian <ms...@csulb.edu>.
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
Re: [users@httpd] help with rewrite rule
Posted by Boysenberry Payne <bo...@humaniteque.com>.
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:
> 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