|
List Info
Thread: http to https redirection with an exception
|
|
| http to https redirection with an
exception |

|
2007-10-14 19:55:51 |
Hi, all.
I'm currently using the RedirectMatch(mod_alias) directive
to redirect
all HTTP requests to corresponding HTTPs urls. My current
httpd.conf is
like this:
____________________________________________________________
____
<VirtualHost *:80>
RedirectMatch permanent '^(/.*)$' 'https://www.example.com$1
'
</VirtualHost>
____________________________________________________________
____
This works fine, and redirects all HTTP requests without
exception.
In addition to this, there is a new condition. I'm trying to
redirect
all requests except "/robots.txt", but I can't
find way to do this. Is
there any good way to do this?
Thanks.
Best regards,
--
Hirotsuna Mizuno <h-mizuno imagecity.jp>
------------------------------------------------------------
---------
The official User-To-User support forum of the Apache HTTP
Server Project.
See <URL:http://htt
pd.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: http to https redirection with an
exception |
  China |
2007-10-14 23:28:32 |
Hi,
You can use mod_rewrite and define a RewriteCond for the
except case.
> Date: Mon, 15 Oct 2007 09:55:51 +0900
> From: h-mizuno imagecity.jp
> To: users httpd.apache.org
> Subject: [users httpd] http to https redirection with an
exception
>
> Hi, all.
>
> I'm currently using the RedirectMatch(mod_alias)
directive to redirect
> all HTTP requests to corresponding HTTPs urls. My
current httpd.conf is
> like this:
>
____________________________________________________________
____
>
> RedirectMatch permanent '^(/.*)$' 'https://www.example.com$1
'
>
>
____________________________________________________________
____
>
> This works fine, and redirects all HTTP requests
without exception.
>
> In addition to this, there is a new condition. I'm
trying to redirect
> all requests except "/robots.txt", but I
can't find way to do this. Is
> there any good way to do this?
>
> Thanks.
>
> Best regards,
> --
> Hirotsuna Mizuno
>
>
>
------------------------------------------------------------
---------
> The official User-To-User support forum of the Apache
HTTP Server Project.
> See 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
>
____________________________________________________________
_____
Connect to the next generation of MSN Messenger
http://imagine-msn.c
om/messenger/launch80/default.aspx?locale=en-us&source=w
lmailtagline
------------------------------------------------------------
---------
The official User-To-User support forum of the Apache HTTP
Server Project.
See <URL:http://htt
pd.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: http to https redirection with an
exception |

|
2007-10-15 18:22:18 |
joy d wrote:
> You can use mod_rewrite and define a RewriteCond for
the except case.
Thank you for your appropriate advice.
Unfortunately, our Apache server was compiled without
mod_rewrite, and
it's not allowed to re-compile it. Therefore, the following
way is our
current candidate.
RedirectMatch permanent '^(/|/[^r].*)$' 'https://www.example.com$1
'
I know it's *really* dull approach. But it works at least
with our site
while it has no resource starting with "r" except
the "robots.txt".
Thank you a lot for thinking about this problem, and if
someone has
other ideas, I hope to hear about that.
Thanks.
Best regards,
--
Hirotsuna Mizuno <h-mizuno imagecity.jp>
------------------------------------------------------------
---------
The official User-To-User support forum of the Apache HTTP
Server Project.
See <URL:http://htt
pd.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: http to https redirection with an
exception |

|
2007-10-15 18:39:05 |
On 10/15/07, ImageCity/Hirotsuna Mizuno <h-mizuno imagecity.jp> wrote:
> joy d wrote:
> > You can use mod_rewrite and define a RewriteCond
for the except case.
>
> Thank you for your appropriate advice.
>
> Unfortunately, our Apache server was compiled without
mod_rewrite, and
> it's not allowed to re-compile it. Therefore, the
following way is our
> current candidate.
>
> RedirectMatch permanent '^(/|/[^r].*)$' 'https://www.example.com$1
'
>
> I know it's *really* dull approach. But it works at
least with our site
> while it has no resource starting with "r"
except the "robots.txt".
>
> Thank you a lot for thinking about this problem, and if
someone has
> other ideas, I hope to hear about that.
Assuming you are using 2.x, you can use a negative-lookahead
in the
regex to match exactly anything other than robots.txt. But
the effect
will be the same.
Joshua.
------------------------------------------------------------
---------
The official User-To-User support forum of the Apache HTTP
Server Project.
See <URL:http://htt
pd.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: http to https redirection with an
exception |

|
2007-10-15 19:04:12 |
Joshua Slive wrote:
> Assuming you are using 2.x, you can use a
negative-lookahead in the
> regex to match exactly anything other than robots.txt.
But the effect
> will be the same.
Thank you so much, that's just what I'm looking for.
Following your
advice, finally, I changed my httpd.conf like this:
RedirectMatch permanent
'^(/(?!robots.txt$).*)$' 'https://www.example.com$1
'
This works fine, and redirects exactly anything other than
robots.txt.
Thank you.
Best Regards,
--
Hirotsuna Mizuno <h-mizuno imagecity.jp>
------------------------------------------------------------
---------
The official User-To-User support forum of the Apache HTTP
Server Project.
See <URL:http://htt
pd.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: http to https redirection with an
exception |

|
2007-10-17 09:03:38 |
On 10/16/07, ImageCity/Hirotsuna Mizuno <h-mizuno imagecity.jp> wrote:
> joy d wrote:
> > You can use mod_rewrite and define a RewriteCond
for the except case.
>
> Thank you for your appropriate advice.
>
> Unfortunately, our Apache server was compiled without
mod_rewrite, and
> it's not allowed to re-compile it.
If your apache was compiled with DSO support you don't need
to
recompile it. You can just compile mod_rewrite and load it
in your
config.
Krist
--
krist.vanbesien gmail.com
krist vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email
discussions?
------------------------------------------------------------
---------
The official User-To-User support forum of the Apache HTTP
Server Project.
See <URL:http://htt
pd.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: http to https redirection with an
exception |
  China |
2007-10-17 22:14:04 |
> Date: Wed, 17 Oct 2007 16:03:38 +0200
> From: krist.vanbesien gmail.com
>
> If your apache was compiled with DSO support you don't
need to
> recompile it. You can just compile mod_rewrite and load
it in your
> config.
>
Hello,
How to do it? can you show me a document reference?
Actually we also have some Apaches which were built with DSO
support,but without mod_rewrite enabled.
If I want to compile and install mod_rewrite separately
without re-compiling Apache,how to do it?
thanks!
____________________________________________________________
_____
Connect to the next generation of MSN Messenger
http://imagine-msn.c
om/messenger/launch80/default.aspx?locale=en-us&source=w
lmailtagline
------------------------------------------------------------
---------
The official User-To-User support forum of the Apache HTTP
Server Project.
See <URL:http://htt
pd.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: http to https redirection with an
exception |

|
2007-10-18 11:57:25 |
On 10/18/07, joy d <joyd hotmail.it> wrote:
>
>
> > Date: Wed, 17 Oct 2007 16:03:38 +0200
> > From: krist.vanbesien gmail.com
> >
> > If your apache was compiled with DSO support you
don't need to
> > recompile it. You can just compile mod_rewrite and
load it in your
> > config.
> >
>
> Hello,
>
> How to do it? can you show me a document reference?
> Actually we also have some Apaches which were built
with DSO support,but without mod_rewrite enabled.
> If I want to compile and install mod_rewrite separately
without re-compiling Apache,how to do it?
First check you have what you need:
- apxs. Usually you'll find that in
<apacheroot>/bin/apxs
- The compiler used to build your apache. You can find out
what apache
has been built with using the following command: ./apxs -q
CC
- the apache source. Best have the same version as the one
allready installed.
Unpack the source and go to the directory where the module
is. In this case
<sourcdir>/modules/mappers
and do:
<apachedir>/bin/apxs -c -i mod_rewrite.c
This command compiles your module, and copies it to the
module dir.
(replace sourcedir with the directory you have unpacked
your source
in, and apachedir with your apache install dir)
Krist
--
krist.vanbesien gmail.com
krist vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email
discussions?
------------------------------------------------------------
---------
The official User-To-User support forum of the Apache HTTP
Server Project.
See <URL:http://htt
pd.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
|
|
[1-8]
|
|