Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

Mod_rewrite question

 

 

First page Previous page 1 2 3 Next page Last page  View All Apache users RSS feed   Index | Next | Previous | View Threaded


A.Isaev at astelit

Dec 18, 2001, 12:03 AM

Post #1 of 51 (3057 views)
Permalink
Mod_rewrite question

Hello users,

How can I solve the following taks?

I have a site e.g. http://www.my-site.com. It was indexed by Search
Engines. And now where a user comes from e.g. http://www.google.com
I'd like to "rewrite" him to my main page. I use the following
statement:

===
RewriteEngine On

RewriteCond %{HTTP_REFERER} ^http://www\.google\.com/ [NC]
RewriteRule /* http://www.my-site.com [R,L]
===

BUT, when I implement it on my site a weird thing happens. When I
click on the link to my site from http://www.google.com the browser
stops responding. After checking my www server log files I've
noticed the following. The browser requests a page from my site and
Apache rewrites it to http://www.my-site.com, but HTTP_REFERER still
contains http://www.google.com and Apache rewrites it again to
http://www.my-site.com and so on. The only way to stop this process
is to press STOP button in my browser.


Thanx in advance.

Best regards,
Alexander Isaev mailto:A.Isaev [at] astelit


---------------------------------------------------------------------
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 [at] httpd
For additional commands, e-mail: users-help [at] httpd


obo at bourse

Dec 18, 2001, 3:00 AM

Post #2 of 51 (2999 views)
Permalink
Re: Mod_rewrite question [In reply to]

Alexander Isaev wrote:
>
> Hello users,
>
> How can I solve the following taks?
>
> I have a site e.g. http://www.my-site.com. It was indexed by Search
> Engines. And now where a user comes from e.g. http://www.google.com
> I'd like to "rewrite" him to my main page. I use the following
> statement:
>
> ===
> RewriteEngine On
>
> RewriteCond %{HTTP_REFERER} ^http://www\.google\.com/ [NC]
> RewriteRule /* http://www.my-site.com [R,L]
> ===
>
> BUT, when I implement it on my site a weird thing happens. When I
> click on the link to my site from http://www.google.com the browser
> stops responding. After checking my www server log files I've
> noticed the following. The browser requests a page from my site and
> Apache rewrites it to http://www.my-site.com, but HTTP_REFERER still
> contains http://www.google.com and Apache rewrites it again to
> http://www.my-site.com and so on. The only way to stop this process
> is to press STOP button in my browser.

Having screwed up a bit on a previous poster's problem, let me have a go
at screwing up your's too :-)

Actually, I think I know this one - you have to rewrite the environment
variable to get out of the loop. You do this using the "E" flag - e.g.

RewriteRule /* http://www.my-site.com [R,L,E=HTTP_REFERER:banana]

so on the second pass (after having been rewritten once), the
HTTP_REFERER will have been changed to "banana" and so will not trip the
rule. Double-check the syntax in the docs but I think that's the right
track to be exploring.

Rgds,

Owen Boyle.

---------------------------------------------------------------------
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 [at] httpd
For additional commands, e-mail: users-help [at] httpd


A.Isaev at astelit

Dec 18, 2001, 6:02 AM

Post #3 of 51 (2993 views)
Permalink
Re[2]: Mod_rewrite question [In reply to]

Hello Owen,

Tuesday, Tuesday, December 18, 2001, you wrote:

OB> Alexander Isaev wrote:
>>
>> Hello users,
>>
>> How can I solve the following taks?
>>
>> I have a site e.g. http://www.my-site.com. It was indexed by Search
>> Engines. And now where a user comes from e.g. http://www.google.com
>> I'd like to "rewrite" him to my main page. I use the following
>> statement:
>>
>> ===
>> RewriteEngine On
>>
>> RewriteCond %{HTTP_REFERER} ^http://www\.google\.com/ [NC]
>> RewriteRule /* http://www.my-site.com [R,L]
>> ===
>>
>> BUT, when I implement it on my site a weird thing happens. When I
>> click on the link to my site from http://www.google.com the browser
>> stops responding. After checking my www server log files I've
>> noticed the following. The browser requests a page from my site and
>> Apache rewrites it to http://www.my-site.com, but HTTP_REFERER still
>> contains http://www.google.com and Apache rewrites it again to
>> http://www.my-site.com and so on. The only way to stop this process
>> is to press STOP button in my browser.

OB> Having screwed up a bit on a previous poster's problem, let me have a go
OB> at screwing up your's too :-)

OB> Actually, I think I know this one - you have to rewrite the environment
OB> variable to get out of the loop. You do this using the "E" flag - e.g.

OB> RewriteRule /* http://www.my-site.com [R,L,E=HTTP_REFERER:banana]

I just tried it. And .. It didn't work.

I've found another way to solve this problem (but I don't like it).

RewriteEngine On

RewriteCond %{HTTP_REFERER} ^http://([a-zA-Z0-9-]*)\.google\.([a-zA-Z0-9-]*)/ [NC]
RewriteRule /* http://www.my-site.com/enter/welcome.htm [R,L]

http://www.my-site.com/enter/welcome.htm is frameset document with
http://www.my-site.com in one frame and another frame is zero height.
Also I've disabled RewriteEngine for
http://www.my-site.com/enter/welcome.htm directory. In this case
rewriting works but sometimes it hangs as I described in my previous
letter.

OB> so on the second pass (after having been rewritten once), the
OB> HTTP_REFERER will have been changed to "banana" and so will not trip the
OB> rule. Double-check the syntax in the docs but I think that's the right
OB> track to be exploring.

OB> Rgds,

OB> Owen Boyle.

OB> ---------------------------------------------------------------------
OB> The official User-To-User support forum of the Apache HTTP Server Project.
OB> See <URL:http://httpd.apache.org/userslist.html> for more info.
OB> To unsubscribe, e-mail: users-unsubscribe [at] httpd
OB> For additional commands, e-mail: users-help [at] httpd




Best regards,
Alexander mailto:A.Isaev [at] astelit


---------------------------------------------------------------------
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 [at] httpd
For additional commands, e-mail: users-help [at] httpd


obo at bourse

Dec 18, 2001, 6:43 AM

Post #4 of 51 (2978 views)
Permalink
Re: Mod_rewrite question [In reply to]

Alexander Isaev wrote:
>
>
> OB> RewriteRule /* http://www.my-site.com [R,L,E=HTTP_REFERER:banana]
>
> I just tried it. And .. It didn't work.

Can't imagine why not. Try switching on rewrite logging and look for the
line:

"setting env variable <xxx> to <yyy>"

Rgds,

owen Boyle.

---------------------------------------------------------------------
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 [at] httpd
For additional commands, e-mail: users-help [at] httpd


joshua at slive

Dec 18, 2001, 7:11 AM

Post #5 of 51 (3001 views)
Permalink
Re: Mod_rewrite question [In reply to]

On Tue, 18 Dec 2001, Alexander Isaev wrote:
> How can I solve the following taks?
>
> I have a site e.g. http://www.my-site.com. It was indexed by Search
> Engines. And now where a user comes from e.g. http://www.google.com
> I'd like to "rewrite" him to my main page. I use the following
> statement:
>
> ===
> RewriteEngine On
>
> RewriteCond %{HTTP_REFERER} ^http://www\.google\.com/ [NC]
> RewriteRule /* http://www.my-site.com [R,L]
> ===
>

First let me say that this is a very nasty thing to do. People are using
google to search for a particular thing, and they found it on a particular
portion of your site. But you are preventing them from accessing that and
shoving them back to your homepage. This blows the whole purpose of
search engines. Google is very aggressive in finding and punishing this
kind of manipulation, so if you do this, you may find your site removed
from google entirely. Even if they don't, I would be loath to visit a
site that did this to me.

Having said that, the proper technique is

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://www\.google\.com/ [NC]
RewriteRule /.+ http://www.my-site.com [R,L]

Your rule said "match any URL with zero or more slashes" (which makes no
sense even if it did not create a loop). My rule says "match any URL with
a slash followed by at least one more character". So my URL will not
rewrite if the user hits the site homepage, thus preventing the loop you
observed.

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 [at] httpd
For additional commands, e-mail: users-help [at] httpd


A.Isaev at astelit

Dec 18, 2001, 7:14 AM

Post #6 of 51 (2989 views)
Permalink
Re[2]: Mod_rewrite question [In reply to]

Hello Owen,

Tuesday, Tuesday, December 18, 2001, you wrote:

OB> Alexander Isaev wrote:
>>
>>
>> OB> RewriteRule /* http://www.my-site.com [R,L,E=HTTP_REFERER:banana]
>>
>> I just tried it. And .. It didn't work.

OB> Can't imagine why not. Try switching on rewrite logging and look for the
OB> line:

OB> "setting env variable <xxx> to <yyy>"

Here is the part of the log file.

195.96.64.172 - - [18/Dec/2001:17:11:01 +0300] [www.my-site.com/sid#82a7fb4][rid#82fe034/initial] (3) [per-dir /usr/home/wwwuser/www/ppee/] strip per-dir prefix: /usr/home/wwwuser/www/ppee/prev.php -> prev.php
195.96.64.172 - - [18/Dec/2001:17:11:01 +0300] [www.my-site.com/sid#82a7fb4][rid#82fe034/initial] (3) [per-dir /usr/home/wwwuser/www/ppee/] applying pattern '/*' to uri 'prev.php'
195.96.64.172 - - [18/Dec/2001:17:11:01 +0300] [www.my-site.com/sid#82a7fb4][rid#82fe034/initial] (4) RewriteCond: input='http://www.google.com/search?q=movies&btnG=Google+Search' pattern='^http://([a-zA-Z0-9-]*)\.google\.([a-zA-Z0-9-]*)/' => matched
195.96.64.172 - - [18/Dec/2001:17:11:01 +0300] [www.my-site.com/sid#82a7fb4][rid#82fe034/initial] (2) [per-dir /usr/home/wwwuser/www/ppee/] rewrite prev.php -> http://www.my-site.com/
195.96.64.172 - - [18/Dec/2001:17:11:01 +0300] [www.my-site.com/sid#82a7fb4][rid#82fe034/initial] (5) setting env variable 'HTTP_REFERER' to 'banana'
195.96.64.172 - - [18/Dec/2001:17:11:01 +0300] [www.my-site.com/sid#82a7fb4][rid#82fe034/initial] (2) [per-dir /usr/home/wwwuser/www/ppee/] explicitly forcing redirect with http://www.my-site.com/
195.96.64.172 - - [18/Dec/2001:17:11:01 +0300] [www.my-site.com/sid#82a7fb4][rid#82fe034/initial] (1) [per-dir /usr/home/wwwuser/www/ppee/] escaping http://www.my-site.com/ for redirect
195.96.64.172 - - [18/Dec/2001:17:11:01 +0300] [www.my-site.com/sid#82a7fb4][rid#82fe034/initial] (1) [per-dir /usr/home/wwwuser/www/ppee/] redirect to http://www.my-site.com/ [REDIRECT/302]
195.96.64.172 - - [18/Dec/2001:17:11:01 +0300] [www.my-site.com/sid#82a7fb4][rid#82fe034/initial] (3) [per-dir /usr/home/wwwuser/www/ppee/] add path-info postfix: /usr/home/wwwuser/www/ppee -> /usr/home/wwwuser/www/ppee/
195.96.64.172 - - [18/Dec/2001:17:11:01 +0300] [www.my-site.com/sid#82a7fb4][rid#82fe034/initial] (3) [per-dir /usr/home/wwwuser/www/ppee/] strip per-dir prefix: /usr/home/wwwuser/www/ppee/ ->
195.96.64.172 - - [18/Dec/2001:17:11:01 +0300] [www.my-site.com/sid#82a7fb4][rid#82fe034/initial] (3) [per-dir /usr/home/wwwuser/www/ppee/] applying pattern '/*' to uri ''
195.96.64.172 - - [18/Dec/2001:17:11:01 +0300] [www.my-site.com/sid#82a7fb4][rid#82fe034/initial] (4) RewriteCond: input='http://www.google.com/search?q=movies&btnG=Google+Search' pattern='^http://([a-zA-Z0-9-]*)\.google\.([a-zA-Z0-9-]*)/' => matched
195.96.64.172 - - [18/Dec/2001:17:11:01 +0300] [www.my-site.com/sid#82a7fb4][rid#82fe034/initial] (2) [per-dir /usr/home/wwwuser/www/ppee/] rewrite -> http://www.my-site.com/

OB> Rgds,

OB> owen Boyle.

OB> ---------------------------------------------------------------------
OB> The official User-To-User support forum of the Apache HTTP Server Project.
OB> See <URL:http://httpd.apache.org/userslist.html> for more info.
OB> To unsubscribe, e-mail: users-unsubscribe [at] httpd
OB> For additional commands, e-mail: users-help [at] httpd




Best regards,
Alexander mailto:A.Isaev [at] astelit


---------------------------------------------------------------------
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 [at] httpd
For additional commands, e-mail: users-help [at] httpd


Billy.Harvey at thrillseeker

Dec 18, 2001, 7:19 AM

Post #7 of 51 (3005 views)
Permalink
Re: Mod_rewrite question [In reply to]

On Tue, 2001-12-18 at 09:11, Joshua Slive wrote:
> On Tue, 18 Dec 2001, Alexander Isaev wrote:
> >
> > I have a site e.g. http://www.my-site.com. It was indexed by Search
> > Engines. And now where a user comes from e.g. http://www.google.com
> > I'd like to "rewrite" him to my main page. I use the following
> > statement:

>
> First let me say that this is a very nasty thing to do. People are using
> google to search for a particular thing, and they found it on a particular
> portion of your site. But you are preventing them from accessing that and
> shoving them back to your homepage. This blows the whole purpose of
> search engines. Google is very aggressive in finding and punishing this
> kind of manipulation, so if you do this, you may find your site removed
> from google entirely. Even if they don't, I would be loath to visit a
> site that did this to me.

There are many valid reasons to require a visitor to begin his
navigation via your front page. The fact that google indexed my site
some time ago - an amount of time that *I* as the most knowledgeable
about the specifics of my site *don't control* - is sufficient alone for
me as the site designer/maintainer to decide if I want to force everyone
to enter via the front page. It is my site - *I* decide on the control
- not google. If the visitor doesn't like my control, he's welcome to
go elsewhere.

I solve this problem, on those sites where needed, by using a session
that times out at a period I specify. Since cookies are an on again/off
again affair for who enables them, etc., I've quit using them for the
most part and generate a unique identifier that is attached to the url
after visiting the home page. Subsequent pages check to see if that
identifier is still valid, and if not redirect my visitor to the home
page. This way a bookmark that's more than a specified time old will
still "work" but in the way I control.

I've also not seen anything about google considering this manipulation,
nor would I care if they do. They're a search engine - not a
self-elected decider of "the right way" to visit my site. That's for me
to decide.

Billy


---------------------------------------------------------------------
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 [at] httpd
For additional commands, e-mail: users-help [at] httpd


A.Isaev at astelit

Dec 18, 2001, 7:26 AM

Post #8 of 51 (2995 views)
Permalink
Re[2]: Mod_rewrite question [In reply to]

Hello Joshua,

Tuesday, Tuesday, December 18, 2001, you wrote:


JS> On Tue, 18 Dec 2001, Alexander Isaev wrote:
>> How can I solve the following taks?
>>
>> I have a site e.g. http://www.my-site.com. It was indexed by Search
>> Engines. And now where a user comes from e.g. http://www.google.com
>> I'd like to "rewrite" him to my main page. I use the following
>> statement:
>>
>> ===
>> RewriteEngine On
>>
>> RewriteCond %{HTTP_REFERER} ^http://www\.google\.com/ [NC]
>> RewriteRule /* http://www.my-site.com [R,L]
>> ===
>>

JS> First let me say that this is a very nasty thing to do. People are using
JS> google to search for a particular thing, and they found it on a particular
JS> portion of your site. But you are preventing them from accessing that and
JS> shoving them back to your homepage. This blows the whole purpose of
JS> search engines. Google is very aggressive in finding and punishing this
JS> kind of manipulation, so if you do this, you may find your site removed
JS> from google entirely. Even if they don't, I would be loath to visit a
JS> site that did this to me.

First of all I'm not redirecting to other sites. The visitor stays
on my SITE.

JS> Having said that, the proper technique is

JS> RewriteEngine On
JS> RewriteCond %{HTTP_REFERER} ^http://www\.google\.com/ [NC]
JS> RewriteRule /.+ http://www.my-site.com [R,L]

I've tried this rewrite code. But it doesn't work. There is no LOOP
no, but i'm not redirecting to my main page.

JS> Your rule said "match any URL with zero or more slashes" (which makes no
JS> sense even if it did not create a loop). My rule says "match any URL with
JS> a slash followed by at least one more character". So my URL will not
JS> rewrite if the user hits the site homepage, thus preventing the loop you
JS> observed.

JS> Joshua.


JS> ---------------------------------------------------------------------
JS> The official User-To-User support forum of the Apache HTTP Server Project.
JS> See <URL:http://httpd.apache.org/userslist.html> for more info.
JS> To unsubscribe, e-mail: users-unsubscribe [at] httpd
JS> For additional commands, e-mail: users-help [at] httpd




Best regards,
Alexander mailto:A.Isaev [at] astelit


---------------------------------------------------------------------
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 [at] httpd
For additional commands, e-mail: users-help [at] httpd


joshua at slive

Dec 18, 2001, 7:35 AM

Post #9 of 51 (2999 views)
Permalink
Re: Mod_rewrite question [In reply to]

On 18 Dec 2001, Billy Harvey wrote:

> On Tue, 2001-12-18 at 09:11, Joshua Slive wrote:
> > First let me say that this is a very nasty thing to do. People are using
> > google to search for a particular thing, and they found it on a particular
> > portion of your site. But you are preventing them from accessing that and
> > shoving them back to your homepage. This blows the whole purpose of
> > search engines. Google is very aggressive in finding and punishing this
> > kind of manipulation, so if you do this, you may find your site removed
> > from google entirely. Even if they don't, I would be loath to visit a
> > site that did this to me.
>
> There are many valid reasons to require a visitor to begin his
> navigation via your front page. The fact that google indexed my site
> some time ago - an amount of time that *I* as the most knowledgeable
> about the specifics of my site *don't control* - is sufficient alone for
> me as the site designer/maintainer to decide if I want to force everyone
> to enter via the front page. It is my site - *I* decide on the control
> - not google. If the visitor doesn't like my control, he's welcome to
> go elsewhere.

I guess we may be drifting off-topic here, but let me make this clear.
You have every right to do whatever you want on your site, but when you
let a search engine index one thing, but then deliberately feed a user
something else, I consider that rude at the least. Good sites are not
this inconsiderate to their users.

If the user is looking for the "mercury sable coup", and you let a very
specific page about that car get in the index, but then when they try to
access it, you give them the "ford" homepage, you are making life more
difficult for the browser and reducing the value of the search engine and
the web in general. If it happens that the "mercury sable coup" page has
moved to a different location, then you should redirect to the most
appropriate new page, not the site homepage.

I don't know how google deals with this particular issue, but I know they
are very strict about banning sites that present one view to a search
engine and a different view to real users. This is a boarderline case,
and I'm not sure what their policy is.

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 [at] httpd
For additional commands, e-mail: users-help [at] httpd


joshua at slive

Dec 18, 2001, 7:39 AM

Post #10 of 51 (2987 views)
Permalink
Re[2]: Mod_rewrite question [In reply to]

On Tue, 18 Dec 2001, Alexander Isaev wrote:
> First of all I'm not redirecting to other sites. The visitor stays
> on my SITE.

That is irrelevant. You are still sending them to a different page than
the one they are looking for.

>
> JS> Having said that, the proper technique is
>
> JS> RewriteEngine On
> JS> RewriteCond %{HTTP_REFERER} ^http://www\.google\.com/ [NC]
> JS> RewriteRule /.+ http://www.my-site.com [R,L]
>
> I've tried this rewrite code. But it doesn't work. There is no LOOP
> no, but i'm not redirecting to my main page.

I am almost sure that this rule is correct. Check again, and post the
rewritelog if you can't figure it out.

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 [at] httpd
For additional commands, e-mail: users-help [at] httpd


A.Isaev at astelit

Dec 19, 2001, 2:09 AM

Post #11 of 51 (2980 views)
Permalink
Re[3]: Mod_rewrite question [In reply to]

Hello Joshua,

Tuesday, Tuesday, December 18, 2001, you wrote:



JS> I am almost sure that this rule is correct. Check again, and post the
JS> rewritelog if you can't figure it out.

Here is the part of the log file

195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (1) [per-dir /usr/home/isaev/www/ppee/] pass through /usr/home/isaev/www/ppee/prev.php
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir /usr/home/isaev/www/ppee/] strip per-dir prefix: /usr/home/isaev/www/ppee/include/general.css -> include/general.css
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir /usr/home/isaev/www/ppee/] applying pattern '/.+' to uri 'include/general.css'
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (4) RewriteCond: input='http://www.marikalos.com/prev.php' pattern='^http://www\.google\.com/' => not-matched
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (1) [per-dir /usr/home/isaev/www/ppee/] pass through /usr/home/isaev/www/ppee/include/general.css
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir /usr/home/isaev/www/ppee/site/] strip per-dir prefix: /usr/home/isaev/www/ppee/site/gals/thumb/bustypee.jpg -> gals/thumb/bustypee.jpg
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir /usr/home/isaev/www/ppee/site/] applying pattern '/*' to uri 'gals/thumb/bustypee.jpg'
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (4) RewriteCond: input='http://www.marikalos.com/prev.php' pattern='!^http://www.marikalos.com/' => not-matched
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (1) [per-dir /usr/home/isaev/www/ppee/site/] pass through /usr/home/isaev/www/ppee/site/gals/thumb/bustypee.jpg
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir /usr/home/isaev/www/ppee/site/] strip per-dir prefix: /usr/home/isaev/www/ppee/site/movies/images/marikalos27p.jpg -> movies/images/marikalos27p.jpg
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir /usr/home/isaev/www/ppee/site/] applying pattern '/*' to uri 'movies/images/marikalos27p.jpg'
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (4) RewriteCond: input='http://www.marikalos.com/prev.php' pattern='!^http://www.marikalos.com/' => not-matched
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (1) [per-dir /usr/home/isaev/www/ppee/site/] pass through /usr/home/isaev/www/ppee/site/movies/images/marikalos27p.jpg
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir /usr/home/isaev/www/ppee/site/] strip per-dir prefix: /usr/home/isaev/www/ppee/site/movies/images/mfstreetpeep.jpg -> movies/images/mfstreetpeep.jpg
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir /usr/home/isaev/www/ppee/site/] applying pattern '/*' to uri 'movies/images/mfstreetpeep.jpg'
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (4) RewriteCond: input='http://www.marikalos.com/prev.php' pattern='!^http://www.marikalos.com/' => not-matched
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (1) [per-dir /usr/home/isaev/www/ppee/site/] pass through /usr/home/isaev/www/ppee/site/movies/images/mfstreetpeep.jpg
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir /usr/home/isaev/www/ppee/site/] strip per-dir prefix: /usr/home/isaev/www/ppee/site/movies/images/marikalos26p.jpg -> movies/images/marikalos26p.jpg
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir /usr/home/isaev/www/ppee/site/] applying pattern '/*' to uri 'movies/images/marikalos26p.jpg'
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (4) RewriteCond: input='http://www.marikalos.com/prev.php' pattern='!^http://www.marikalos.com/' => not-matched
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (1) [per-dir /usr/home/isaev/www/ppee/site/] pass through /usr/home/isaev/www/ppee/site/movies/images/marikalos26p.jpg
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir /usr/home/isaev/www/ppee/site/] strip per-dir prefix: /usr/home/isaev/www/ppee/site/movies/images/marikalos25p.jpg -> movies/images/marikalos25p.jpg
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir /usr/home/isaev/www/ppee/site/] applying pattern '/*' to uri 'movies/images/marikalos25p.jpg'
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (4) RewriteCond: input='http://www.marikalos.com/prev.php' pattern='!^http://www.marikalos.com/' => not-matched
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (1) [per-dir /usr/home/isaev/www/ppee/site/] pass through /usr/home/isaev/www/ppee/site/movies/images/marikalos25p.jpg
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir /usr/home/isaev/www/ppee/site/] strip per-dir prefix: /usr/home/isaev/www/ppee/site/movies/images/marikalos24p.jpg -> movies/images/marikalos24p.jpg
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir /usr/home/isaev/www/ppee/site/] applying pattern '/*' to uri 'movies/images/marikalos24p.jpg'
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (4) RewriteCond: input='http://www.marikalos.com/prev.php' pattern='!^http://www.marikalos.com/' => not-matched
195.96.64.172 - - [19/Dec/2001:12:06:21 +0300] [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (1) [per-dir /usr/home/isaev/www/ppee/site/] pass through /usr/home/isaev/www/ppee/site/movies/images/marikalos24p.jpg

JS> Joshua.


JS> ---------------------------------------------------------------------
JS> The official User-To-User support forum of the Apache HTTP Server Project.
JS> See <URL:http://httpd.apache.org/userslist.html> for more info.
JS> To unsubscribe, e-mail: users-unsubscribe [at] httpd
JS> For additional commands, e-mail: users-help [at] httpd




Best regards,
Alexander mailto:A.Isaev [at] astelit


---------------------------------------------------------------------
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 [at] httpd
For additional commands, e-mail: users-help [at] httpd


joshua at slive

Dec 19, 2001, 7:06 AM

Post #12 of 51 (2988 views)
Permalink
RE: Re[3]: Mod_rewrite question [In reply to]

> From: Alexander Isaev [mailto:A.Isaev [at] astelit]


> Here is the part of the log file
>

> [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir
> /usr/home/isaev/www/ppee/] strip per-dir prefix:
> /usr/home/isaev/www/ppee/include/general.css -> include/general.css
> 195.96.64.172 - - [19/Dec/2001:12:06:21 +0300]
> [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir
> /usr/home/isaev/www/ppee/] applying pattern '/.+' to uri
> 'include/general.css'

Yep, that's what I guessed: you are using this in an .htaccess file or
<directory> section. Don't. Put it in the httpd.conf in the main server
context (outside any <directory> section).

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 [at] httpd
For additional commands, e-mail: users-help [at] httpd


A.Isaev at astelit

Dec 21, 2001, 1:14 AM

Post #13 of 51 (2996 views)
Permalink
Re[5]: Mod_rewrite question [In reply to]

Hello users,

Wednesday, Wednesday, December 19, 2001, you wrote:



>> From: Alexander Isaev [mailto:A.Isaev [at] astelit]


>> Here is the part of the log file
>>

>> [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir
>> /usr/home/isaev/www/ppee/] strip per-dir prefix:
>> /usr/home/isaev/www/ppee/include/general.css -> include/general.css
>> 195.96.64.172 - - [19/Dec/2001:12:06:21 +0300]
>> [www.marikalos.com/sid#82dafb4][rid#830c034/initial] (3) [per-dir
>> /usr/home/isaev/www/ppee/] applying pattern '/.+' to uri
>> 'include/general.css'

JS> Yep, that's what I guessed: you are using this in an .htaccess file or
JS> <directory> section. Don't. Put it in the httpd.conf in the main server
JS> context (outside any <directory> section).

Can I put it into VirtualHost section (I tried and it doesn't work).
If I'll put this rewrite code into main server context - it'll effect
all site hosted on my machine, but I need to implement rewriting
method only for selected virtual hosts.

JS> Joshua.




Best regards,
Alexander mailto:A.Isaev [at] astelit


---------------------------------------------------------------------
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 [at] httpd
For additional commands, e-mail: users-help [at] httpd


A.Isaev at astelit

Dec 24, 2001, 1:04 AM

Post #14 of 51 (2995 views)
Permalink
Re[7]: Mod_rewrite question [In reply to]

Hello users,

Thursday, Thursday, December 20, 2001, you wrote:


JS> To answer your question, yes it should work in a <virtualhost> section. I
JS> can't provide any help beyond that if you don't provide details.

Sorry. I'll fix the situation.

Here is the part of httpd.conf

<VirtualHost 195.96.65.10>
DocumentRoot /usr/home/isaev/www/marikalos
ServerName www.marikalos.com
RewriteEngine On
RewriteLog "/usr/home/isaev/logs/marikalos-rewrite.log"
RewriteLogLevel 9
RewriteCond %{HTTP_REFERER} ^http://www\.google\.com/ [NC]
RewriteRule /.+ http://www.marikalos.com [R,L]
</VirtualHost>

Here is a .htaccess from root of www.marikalos.ru (It doesn't affect
on rewrite rule for www.google.com)

RewriteEngine On

RewriteCond %{HTTP:Accept-Language} ru [NC]
RewriteRule ^$ /rcz/1/ [R]

And here is the part of the log file:

195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (2) init rewrite engine with requested uri
/main.html
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) applying pattern '/.+' to uri
'/main.html'
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (4) RewriteCond:
input='http://www.google.com/search?q=public+marikalos&btnG=Google+Search'
pattern='^http://www\.google\.com/' => matched
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (2) rewrite /main.html ->
http://www.marikalos.com
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (2) explicitly forcing redirect with
http://www.marikalos.com
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (1) redirect to http://www.marikalos.com
[REDIRECT/302]
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (2) init rewrite engine with requested uri /
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) applying pattern '/.+' to uri '/'
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (1) pass through /
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) [per-dir
/usr/home/isaev/www/pmarikalos/] add path-info postfix: /usr/home/isaev/www/pmarikalos ->
/usr/home/isaev/www/pmarikalos/
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) [per-dir
/usr/home/isaev/www/pmarikalos/] strip per-dir prefix: /usr/home/isaev/www/pmarikalos/ ->
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) [per-dir
/usr/home/isaev/www/pmarikalos/] applying pattern '^$' to uri ''
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (4) RewriteCond: input='en-us' pattern='ru'
=> not-matched
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (1) [per-dir
/usr/home/isaev/www/pmarikalos/] pass through /usr/home/isaev/www/pmarikalos
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#832c034/subreq] (2) init rewrite engine with requested uri
/index.html
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#832c034/subreq] (1) pass through /index.html
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (2) init rewrite engine with
requested uri /index.html
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (3) applying pattern '/.+' to uri
'/index.html'
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (4) RewriteCond:
input='http://www.google.com/search?q=public+marikalos&btnG=Google+Search'
pattern='^http://www\.google\.com/' => matched
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (2) rewrite /index.html ->
http://www.marikalos.com
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (2) explicitly forcing redirect
with http://www.marikalos.com
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (1) redirect to
http://www.marikalos.com [REDIRECT/302]
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (2) init rewrite engine with requested uri /
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) applying pattern '/.+' to uri '/'
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (1) pass through /
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) [per-dir
/usr/home/isaev/www/pmarikalos/] add path-info postfix: /usr/home/isaev/www/pmarikalos ->
/usr/home/isaev/www/pmarikalos/
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) [per-dir
/usr/home/isaev/www/pmarikalos/] strip per-dir prefix: /usr/home/isaev/www/pmarikalos/ ->
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) [per-dir
/usr/home/isaev/www/pmarikalos/] applying pattern '^$' to uri ''
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (4) RewriteCond: input='en-us' pattern='ru'
=> not-matched
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (1) [per-dir
/usr/home/isaev/www/pmarikalos/] pass through /usr/home/isaev/www/pmarikalos
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#832c034/subreq] (2) init rewrite engine with requested uri
/index.html
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#832c034/subreq] (1) pass through /index.html
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (2) init rewrite engine with
requested uri /index.html
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (3) applying pattern '/.+' to uri
'/index.html'
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (4) RewriteCond:
input='http://www.google.com/search?q=public+marikalos&btnG=Google+Search'
pattern='^http://www\.google\.com/' => matched
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (2) rewrite /index.html ->
http://www.marikalos.com
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (2) explicitly forcing redirect
with http://www.marikalos.com
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (1) redirect to
http://www.marikalos.com [REDIRECT/302]
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (2) init rewrite engine with requested uri /
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) applying pattern '/.+' to uri '/'
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (1) pass through /
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) [per-dir
/usr/home/isaev/www/pmarikalos/] add path-info postfix: /usr/home/isaev/www/pmarikalos ->
/usr/home/isaev/www/pmarikalos/
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) [per-dir
/usr/home/isaev/www/pmarikalos/] strip per-dir prefix: /usr/home/isaev/www/pmarikalos/ ->
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) [per-dir
/usr/home/isaev/www/pmarikalos/] applying pattern '^$' to uri ''
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (4) RewriteCond: input='en-us' pattern='ru'
=> not-matched
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (1) [per-dir
/usr/home/isaev/www/pmarikalos/] pass through /usr/home/isaev/www/pmarikalos
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#832c034/subreq] (2) init rewrite engine with requested uri
/index.html
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#832c034/subreq] (1) pass through /index.html
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (2) init rewrite engine with
requested uri /index.html
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (3) applying pattern '/.+' to uri
'/index.html'
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (4) RewriteCond:
input='http://www.google.com/search?q=public+marikalos&btnG=Google+Search'
pattern='^http://www\.google\.com/' => matched
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (2) rewrite /index.html ->
http://www.marikalos.com
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (2) explicitly forcing redirect
with http://www.marikalos.com
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (1) redirect to
http://www.marikalos.com [REDIRECT/302]
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (2) init rewrite engine with requested uri /
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) applying pattern '/.+' to uri '/'
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (1) pass through /
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) [per-dir
/usr/home/isaev/www/pmarikalos/] add path-info postfix: /usr/home/isaev/www/pmarikalos ->
/usr/home/isaev/www/pmarikalos/
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) [per-dir
/usr/home/isaev/www/pmarikalos/] strip per-dir prefix: /usr/home/isaev/www/pmarikalos/ ->
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (3) [per-dir
/usr/home/isaev/www/pmarikalos/] applying pattern '^$' to uri ''
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (4) RewriteCond: input='en-us' pattern='ru'
=> not-matched
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#8304034/initial] (1) [per-dir
/usr/home/isaev/www/pmarikalos/] pass through /usr/home/isaev/www/pmarikalos
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#832c034/subreq] (2) init rewrite engine with requested uri
/index.html
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#832c034/subreq] (1) pass through /index.html
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (2) init rewrite engine with
requested uri /index.html
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (3) applying pattern '/.+' to uri
'/index.html'
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (4) RewriteCond:
input='http://www.google.com/search?q=public+marikalos&btnG=Google+Search'
pattern='^http://www\.google\.com/' => matched
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (2) rewrite /index.html ->
http://www.marikalos.com
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (2) explicitly forcing redirect
with http://www.marikalos.com
195.96.64.172 - - [21/Dec/2001:11:31:46 +0300]
[www.marikalos.com/sid#82aafb4][rid#830572c/initial/redir#1] (1) redirect to
http://www.marikalos.com [REDIRECT/302]


Best regards,
Alexander Isaev mailto:A.Isaev [at] astelit


---------------------------------------------------------------------
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 [at] httpd
For additional commands, e-mail: users-help [at] httpd


nate.lists at tbh

Jun 17, 2002, 10:14 AM

Post #15 of 51 (2994 views)
Permalink
Re: mod_rewrite question [In reply to]

Heh.. That is the exact answer I needed. That is why this list rocks.

Thanks Joshua!

Nate D.


----- Original Message -----
From: "Joshua Slive" <joshua [at] slive>
To: "Apache List" <users [at] httpd>
Sent: Monday, June 17, 2002 1:05 PM
Subject: Re: mod_rewrite question


>
> On Mon, 17 Jun 2002, Nate wrote:
> > Problem: I have a site, www.domain.com. I want to redirect
> > www.domain.com/blah/blah.nsf/* back to the main site (www.domain.com).
The
> > requested link used to go to a Notes database that now doesn't exist, so
I
> > want to redirect everyone back to the main site. I can't seem to get it
to
> > work.
>
> RedirectMatch /blah/blah.nsf.* http://www.domain.com/
>
> or if you really want mod_rewrite
>
> RewriteEngine On
> RewriteRule ^/blah/blah.nsf.* http://www.domain.com/
>
> Joshua.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


public at utkalika

Jan 9, 2003, 3:54 PM

Post #16 of 51 (3007 views)
Permalink
Re: mod_rewrite question [In reply to]

Thanks Rich,
I tried the ServerAlias directive like the one below but couldn't get it to
work

<VirtualHost xxx.xxx.xxx.xxx:80>
ServerName www.domain.net
ServerAlias www.domain.org
ServerAlias www.domain.com
UseCanonicalName Off
..............
.............
</VirtualHost>

Regards
R'twick
----- Original Message -----
From: "Rich Bowen" <rbowen [at] rcbowen>
To: <users [at] httpd>
Sent: Thursday, January 09, 2003 5:44 PM
Subject: Re: [users [at] http] mod_rewrite question


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Thu, 9 Jan 2003, R'twick Niceorgaw wrote:
>
> > Hi all,
> > pardon me for this silly question but i'm new to apache and my boss
wants
> > to figure out this quickly.
> >
> > My problem is , we have few domains but want all of them to be
redirected to
> > one domain like
> > if a user goes to http://www.domain1.com he sees http://www.domain1.net
or
> > http://www.domain1.com/xyz goes to https://www.domain1.net/xyz
> > samething for https also.
> > I tried to do it with mod_rewrite but couldn't get anything usefull
after
> > reading the documents.
>
> ServerAlias is the directive that you're looking for - lets you list
> alternate names for the same site. No redirection or rewriting is needed
> unless you really want to.
>
> If you really feel that you must redirect, then a simple Redirect is all
> that is necessary:
>
> Redirect / http://other.name.net/
>
> Path information is preserved, so /something would go to
> http://other.name.net/something
>
> - --
> Rich Bowen - rbowen [at] rcbowen
> http://kenya.rcbowen.com/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
> Comment: Made with pgp4pine 1.75-6
>
> iD8DBQE+HftfXP03+sx4yJMRApISAJ9H4sMJLGksnzD23jrJdiUrKrRwgwCgxGI4
> ISd5oXvhkSs7RZAhWm2aMkQ=
> =VNmP
> -----END PGP SIGNATURE-----
>
>
>
> ---------------------------------------------------------------------
> 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 [at] httpd
> " from the digest: users-digest-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>



---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


public at utkalika

Jan 9, 2003, 4:02 PM

Post #17 of 51 (2990 views)
Permalink
Re: mod_rewrite question - Fixed [In reply to]

Thanks a lot.
I got it working using Redirect directive.

R'twick
----- Original Message -----
From: "R'twick Niceorgaw" <public [at] utkalika>
To: <users [at] httpd>
Sent: Thursday, January 09, 2003 5:54 PM
Subject: Re: [users [at] http] mod_rewrite question


> Thanks Rich,
> I tried the ServerAlias directive like the one below but couldn't get it
to
> work
>
> <VirtualHost xxx.xxx.xxx.xxx:80>
> ServerName www.domain.net
> ServerAlias www.domain.org
> ServerAlias www.domain.com
> UseCanonicalName Off
> ..............
> .............
> </VirtualHost>
>
> Regards
> R'twick
> ----- Original Message -----
> From: "Rich Bowen" <rbowen [at] rcbowen>
> To: <users [at] httpd>
> Sent: Thursday, January 09, 2003 5:44 PM
> Subject: Re: [users [at] http] mod_rewrite question
>
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On Thu, 9 Jan 2003, R'twick Niceorgaw wrote:
> >
> > > Hi all,
> > > pardon me for this silly question but i'm new to apache and my boss
> wants
> > > to figure out this quickly.
> > >
> > > My problem is , we have few domains but want all of them to be
> redirected to
> > > one domain like
> > > if a user goes to http://www.domain1.com he sees
http://www.domain1.net
> or
> > > http://www.domain1.com/xyz goes to https://www.domain1.net/xyz
> > > samething for https also.
> > > I tried to do it with mod_rewrite but couldn't get anything usefull
> after
> > > reading the documents.
> >
> > ServerAlias is the directive that you're looking for - lets you list
> > alternate names for the same site. No redirection or rewriting is needed
> > unless you really want to.
> >
> > If you really feel that you must redirect, then a simple Redirect is all
> > that is necessary:
> >
> > Redirect / http://other.name.net/
> >
> > Path information is preserved, so /something would go to
> > http://other.name.net/something
> >
> > - --
> > Rich Bowen - rbowen [at] rcbowen
> > http://kenya.rcbowen.com/
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.2.1 (GNU/Linux)
> > Comment: Made with pgp4pine 1.75-6
> >
> > iD8DBQE+HftfXP03+sx4yJMRApISAJ9H4sMJLGksnzD23jrJdiUrKrRwgwCgxGI4
> > ISd5oXvhkSs7RZAhWm2aMkQ=
> > =VNmP
> > -----END PGP SIGNATURE-----
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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 [at] httpd
> > " from the digest: users-digest-unsubscribe [at] httpd
> > For additional commands, e-mail: users-help [at] httpd
> >
>
>
>
> ---------------------------------------------------------------------
> 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 [at] httpd
> " from the digest: users-digest-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>



---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


j.knowling at mgn

Jun 26, 2003, 10:00 AM

Post #18 of 51 (2985 views)
Permalink
Re: Mod_Rewrite question [In reply to]

Hi Patrick,

I'm not sure about the RewriteCond on %{DOCUMENT_ROOT} in your example, so
I'm not sure if I have missed the point of what you want to do, but
maybe...

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://([^/]+)
RewriteRule ^(.*)$ /server/%1/$1 [L]

will do what you want. So you match the value of the referrer fromthe
"http://" up to the first slash in the RewriteCond, then in the
rewriteline, you rewrite the requested URI to /server/%1/$1 where %1 is the
value matched in the referrer ([^/]+) and $1 is the value matched by the
rewriterule ^(.*)$ - the uri requested from the browser.

James.



|---------+---------------------------->
| | Patrick Donker |
| | <padonker [at] report|
| | rs.net> |
| | |
| | 26/06/2003 00:44 |
| | Please respond to|
| | users |
| | |
|---------+---------------------------->
>------------------------------------------------------------------------------------------------------------------------------|
| |
| To: users [at] httpd |
| cc: |
| Subject: [users [at] http] Mod_Rewrite question |
>------------------------------------------------------------------------------------------------------------------------------|




Hi guys,

1st of all, I'm a total newbe to both this mailinglist and mod_rewrite,
so pardon me if I'm asking this question while it has been asked a
zillion times before, or if it is the wrong place to ask it.
My problem is the following:

I'd like to define a DocumentRoot based on the referer. So, if referer
would be http://www.somesite.com/, docroot should be
/server/www.somesite.com. If ref is http://192.168.0.100, then
/server/192.168.0.100.
My (non-functional) rule is:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://www.somesite.com/$ [NC]
RewriteCond %(DOCUMENT_ROOT) !^/var/www/html$
RewriteRule ^/$1 /server/www.somesite.com [R,L]

Obviousely, this doesnt work...how DO I make it work???
Thanks for any hints

Patrick


---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd







********************
IMPORTANT NOTICE This email (including any attachments) is meant only for the intended recipient. It may also contain confidential and privileged information. If you are not the intended recipient, any reliance on, use, disclosure, distribution or copying of this email or attachments is strictly prohibited. Please notify the sender immediately by email if you have received this message by mistake and delete the email and all attachments.

Any views or opinions in this email are solely those of the author and do not necessarily represent those of Trinity Mirror PLC or its associated group companies (hereinafter referred to as "TM Group"). TM Group accept no liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Although every reasonable effort is made to keep its network free from viruses, TM Group accept no liability for any virus transmitted by this email or any attachments and the recipient should use up-to-date virus checking software. Email to or from this address may be subject to interception or monitoring for operational reasons or for lawful business practices.

Trinity Mirror PLC is the parent company of the Trinity Mirror group of companies and is registered in England No 82548, with its address at One Canada Square, Canary Wharf, London E14 5AP.
********************

---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


padonker at reporters

Jun 26, 2003, 10:26 AM

Post #19 of 51 (2982 views)
Permalink
Re: Mod_Rewrite question [In reply to]

Let me clearify my problem a bit
I have a domain, say www.somesite.com, which is ip-forwarded to me. What
I dont want is that whenever people connect to me ip-wise, they will end
up on the somesite.com site. If one would connect to somesite.com,
according to my access_log, a connection is made to my ip, referer
somesite.com. If I connect to me on ip, referer would be the ip-number.
I also have a dyndns.org account, which connects in a similair way.
I know there is such a thing as VirtualDocumentRoot (not sure if it is
called exactly like this), but that isnt fool-proof either. I prefer
mod_rewrite as it is a more flexible solution which keeps possible
future domain-names open.
Hope this is helps you understand my problem a bit better

P

j.knowling [at] mgn wrote:

>Hi Patrick,
>
>I'm not sure about the RewriteCond on %{DOCUMENT_ROOT} in your example, so
>I'm not sure if I have missed the point of what you want to do, but
>maybe...
>
>RewriteEngine On
>RewriteCond %{HTTP_REFERER} ^http://([^/]+)
>RewriteRule ^(.*)$ /server/%1/$1 [L]
>
>will do what you want. So you match the value of the referrer fromthe
>"http://" up to the first slash in the RewriteCond, then in the
>rewriteline, you rewrite the requested URI to /server/%1/$1 where %1 is the
>value matched in the referrer ([^/]+) and $1 is the value matched by the
>rewriterule ^(.*)$ - the uri requested from the browser.
>
>James.
>
>
>
>|---------+---------------------------->
>| | Patrick Donker |
>| | <padonker [at] report|
>| | rs.net> |
>| | |
>| | 26/06/2003 00:44 |
>| | Please respond to|
>| | users |
>| | |
>|---------+---------------------------->
> >------------------------------------------------------------------------------------------------------------------------------|
> | |
> | To: users [at] httpd |
> | cc: |
> | Subject: [users [at] http] Mod_Rewrite question |
> >------------------------------------------------------------------------------------------------------------------------------|
>
>
>
>
>Hi guys,
>
>1st of all, I'm a total newbe to both this mailinglist and mod_rewrite,
>so pardon me if I'm asking this question while it has been asked a
>zillion times before, or if it is the wrong place to ask it.
>My problem is the following:
>
>I'd like to define a DocumentRoot based on the referer. So, if referer
>would be http://www.somesite.com/, docroot should be
>/server/www.somesite.com. If ref is http://192.168.0.100, then
>/server/192.168.0.100.
>My (non-functional) rule is:
>
>RewriteEngine on
>RewriteCond %{HTTP_REFERER} !^http://www.somesite.com/$ [NC]
>RewriteCond %(DOCUMENT_ROOT) !^/var/www/html$
>RewriteRule ^/$1 /server/www.somesite.com [R,L]
>
>Obviousely, this doesnt work...how DO I make it work???
>Thanks for any hints
>
>Patrick
>
>
>---------------------------------------------------------------------
>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 [at] httpd
> " from the digest: users-digest-unsubscribe [at] httpd
>For additional commands, e-mail: users-help [at] httpd
>
>
>
>
>
>
>
>********************
>IMPORTANT NOTICE This email (including any attachments) is meant only for the intended recipient. It may also contain confidential and privileged information. If you are not the intended recipient, any reliance on, use, disclosure, distribution or copying of this email or attachments is strictly prohibited. Please notify the sender immediately by email if you have received this message by mistake and delete the email and all attachments.
>
>Any views or opinions in this email are solely those of the author and do not necessarily represent those of Trinity Mirror PLC or its associated group companies (hereinafter referred to as "TM Group"). TM Group accept no liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Although every reasonable effort is made to keep its network free from viruses, TM Group accept no liability for any virus transmitted by this email or any attachments and the recipient should use up-to-date virus checking software. Email to or from this address may be subject to interception or monitoring for operational reasons or for lawful business practices.
>
>Trinity Mirror PLC is the parent company of the Trinity Mirror group of companies and is registered in England No 82548, with its address at One Canada Square, Canary Wharf, London E14 5AP.
>********************
>
>---------------------------------------------------------------------
>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 [at] httpd
> " from the digest: users-digest-unsubscribe [at] httpd
>For additional commands, e-mail: users-help [at] httpd
>
>
>
>



---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


jed at ur

Dec 11, 2003, 8:04 AM

Post #20 of 51 (3004 views)
Permalink
RE: mod_rewrite question [In reply to]

Thanks, I'm busy trying it out...

/jim

-----Original Message-----
From: Robert Andersson [mailto:robert [at] profundis]
Sent: den 11 december 2003 06:49
To: users [at] httpd
Subject: Re: [users [at] http] mod_rewrite question

Edwards Jim wrote:
> I need to rewrite some URLs:
> Case 1:
> http://localhost/folder/parent.php
> -> http://localhost/parent
>
> Case 2:
> http://localhost/folder/child.php?parent=parent
> -> http://localhost/parent/child
>
> is this possible using mod_rewrite on Apache.

Probably. I am not certain of the semantics here, but assuming both "parent"
and "child" are variable names, this would do it:

RewriteEngine On
RewriteRule ^/folder/(\w+)\.php /$1/
RewriteRule ^/folder/(\w+)\.php\?parent=(\w+) /$2/$1

I added a trailing slash to the first case, as I assumed it's was a
directory? You might need to change "(\w+)" to be a character class to
include whatever characters "parent" or "child" might contains, eg:
"([\w-_\.]+)", or maybe just "(.+)". If you're not very familiar with
regular expressions you should read:

http://www.perldoc.com/perl5.6.1/pod/perlre.html

Regards,
Robert Andersson


---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


jed at ur

Dec 11, 2003, 10:04 AM

Post #21 of 51 (2989 views)
Permalink
RE: mod_rewrite question [In reply to]

Hello Robert,
I got it working using:
RewriteRule ^([A-Za-z0-9_]+)*$ /folder/$1.php [L]
RewriteRule ^([A-Za-z0-9_]+)/([A-Za-z0-9_]+)*$ /folder/$2.php?parent=$1 [L]

Thanks for pointing me in the right direction.

Jim Edwards

-----Original Message-----
From: Robert Andersson [mailto:robert [at] profundis]
Sent: den 11 december 2003 06:57
To: users [at] httpd
Subject: Re: [users [at] http] mod_rewrite question

Robert Andersson wrote:
> Probably. [...] this would do it:

Probably not :( I must not be getting enough coffee...

> RewriteEngine On
> RewriteRule ^/folder/(\w+)\.php /$1/
> RewriteRule ^/folder/(\w+)\.php\?parent=(\w+) /$2/$1

Correction:

RewriteRule ^/folder/(\w+)\.php$ /$1/
RewriteRule ^/folder/(\w+)\.php\?parent=(\w+)$ /$2/$1

Note the end anchor $; without it this wouldn't work very well.

Regards,
Robert Andersson

---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


paul.aviles at palei

Mar 14, 2006, 7:47 AM

Post #22 of 51 (2995 views)
Permalink
Re: mod_rewrite question [In reply to]

That is correct. My understanding is that Cisco Pix 505 can't do the port
forwarding so that is the reason why I was looking on doing this.

Thanks

--
Paul Aviles

---------- Original Message -----------
From: "Gaël Lams" <lamsgael [at] gmail>
To: users [at] httpd
Sent: Tue, 14 Mar 2006 14:14:45 +0100
Subject: Re: [users [at] http] mod_rewrite question

> Hi
>
> > I am pulling my hair out with this. I have a single public IP and already
> > have a web server redirected on the firewall from the external IP to the
> > private IP of 10.5.36.5. Now I need to enable another box (10.5.36.6)
> > running on port 80 to be accessible from the outside.
>
> 10.5.36.6 is a physically separated server, isn't it (you said
> "another box")? If it's the case, it has nothing to do with
> mod_rewrite, only with your firewall (I suppose that you only have
> one unique public ip address). You need to configure your firewall
> to forward requests made oon port 81 to 10.5.36.6:80.
>
> Regards,
>
> Gaël
------- End of Original Message -------


---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


lamsgael at gmail

Mar 17, 2006, 5:52 AM

Post #23 of 51 (2971 views)
Permalink
Re: mod_rewrite question [In reply to]

> That is correct. My understanding is that Cisco Pix 505 can't do the port
> forwarding so that is the reason why I was looking on doing this.

If the only option you have is to open port 81 on the fw and send it
to port 81 on the same 10.5.36.5, you have to to configure iptable on
10.5.36.5 to forward what arrives on port 81 to port 80 on 10.5.36.6.
That's really the only solution I can think about

Regards,

Gaëk


joshua at slive

Mar 17, 2006, 4:11 PM

Post #24 of 51 (2981 views)
Permalink
Re: mod_rewrite question [In reply to]

On 3/17/06, Gaël Lams <lamsgael [at] gmail> wrote:
> > That is correct. My understanding is that Cisco Pix 505 can't do the port
> > forwarding so that is the reason why I was looking on doing this.
>
> If the only option you have is to open port 81 on the fw and send it
> to port 81 on the same 10.5.36.5, you have to to configure iptable on
> 10.5.36.5 to forward what arrives on port 81 to port 80 on 10.5.36.6.
> That's really the only solution I can think about

In fact, mod_rewrite can do exactly what is wanted here by acting as a
reverse proxy using the [P] flag and mod_proxy. (It is not really
port-forwarding, since it acts at a different network layer, but the
effect is similar.)

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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


joshua at slive

Aug 24, 2006, 5:20 PM

Post #25 of 51 (2853 views)
Permalink
Re: mod_rewrite question [In reply to]

On 8/24/06, Eoin Coffey <ecoffey [at] gmail> wrote:
> Hey There,
>
> After reading the faq, docs, and browsing the usenet I'm still stumped.
>
> Here's the setup.
>
> My work is using port based virtual servers to manage our dev projects. So
> same IP address, but it will server up a different docroot depending on the
> port number.
>
> I've put the 'RewriteEngine on' in the relevant <VirtualHost> directive. I
> also created a simple .htaccess file in the docroot with:
>
> 'RewriteEngine on
>
> RewriteBase /
>
> RewriteRule ^yarg\.php$ index.php'
>
> But /yarg.php still gives me a 404 error.
>
> As a sidenote I also added 'RewriteLog rewrite_log' and 'RewriteLogLevel 9'
> to .htaccess, but the log file is not created, which makes me suspect the
> rewrite engine doesn't even kick in.
>
> We're running Apache 2.2.0 on a Fedora Core box.
>
> I've verified that mod_rewrite is loaded with get_apache_modules().
>
> A pre-thanks for the help, and a apology for any lack of information or
> confusion on my part.

RewriteLog isn't even allowed in .htaccess files. So this tells me
you have AllowOverride set to prevent apache from reading .htaccess
files.

But don't fix that. Just put the RewriteRules in httpd.conf where they belong:
RewriteEngine On
RewriteRule ^/yarg\.php$ index.php'

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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

First page Previous page 1 2 3 Next page Last page  View All Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.