RE: Automatic Redirect to a Secure Page in Apache 2.2.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there --

I got it to work using the following syntax in the httpd.conf file:

<VirtualHost <FQDN:80>
	ServerName	FQDN
	ServerAdmin	<email address>
	DocumentRoot 	/var/www/html
	DirectoryIndex 	index.html index.shtml
	RewriteEngine	on
	RewtireCond		%{SERVER_PORT} ^80$
	RewriteRule		^/premium(.*)$ https:FQDN/registered$l [L,R]
	RewriteLog		"/var/log/httpd/rewrite.log"
	RewriteLogLevel	4
	Redirect /		https:FQDN/
</VirtualHost>

I restarted Apache, and when I entered the text http:FQDN/mail, I was redirected
to the secure page. Thanks for the help. 

-----Original Message-----
From: Vincent Bray [mailto:noodlet@xxxxxxxxx] 
Sent: Wednesday, March 07, 2007 9:52 AM
To: users@xxxxxxxxxxxxxxxx
Subject: Re:  Automatic Redirect to a Secure Page in Apache 2.2.2

On 07/03/07, Kaplan, Andrew H. <AHKAPLAN@xxxxxxxxxxxx> wrote:
> Hi there --
>
> I checked the ssl.conf file, and there is a RedirectPermanent line already in
> place. The line reads as follows:
>
> RedirectPermanent http://<website/alias> "https://<website/alias>"

That's wrong for two reasons. The first argument to
Redirect(Permanent) is a local uri reference such as / or /foo/bar.baz
etc. Using http://.. for that argument will never match. And speaking
of never matching, the directive is in the wrong place if it's in the
ssl vhost. non-ssl requests are governed by a separate context (a
different VirtualHost) so if you want to redirect http://.. requests,
you must edit the http://.. vhost. Makes sense?

-- 
noodl

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx






The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance HelpLine at 800-856-1983 and properly dispose of this information.


---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux