Forum Moderators: phranque

Message Too Old, No Replies

https to http

Want to redirect https to http

         

atul_iiit

1:57 pm on Aug 12, 2005 (gmt 0)

10+ Year Member



Hi Apache Gurus,
I am new to web server so ignore if this sounds silly.
I have webserver listening on https as well on http . I want to redirect all requests which comes for https to http so I need a rewrite rule.

For Example when a request comes for

https:/<servername>.<domain name>/**** It should be directed to

http:/<servername>.<domain name>/****

can some one please tell me how to write Rewrite Code for this .

John Carpenter

4:11 pm on Aug 12, 2005 (gmt 0)

10+ Year Member



For instance:

# Redirect to from https to http
RewriteCond %{HTTPS} on
RewriteRule ^www.example.com/(.*) http://www.example.com/$1 [R=permanent,L]

[edited by: jdMorgan at 9:12 pm (utc) on Aug. 13, 2005]
[edit reason] example.com. [/edit]

John Carpenter

4:13 pm on Aug 12, 2005 (gmt 0)

10+ Year Member



And it should be preceded by:

RewriteEngine On

John Carpenter

4:47 pm on Aug 12, 2005 (gmt 0)

10+ Year Member



By the way, the hyperlink was created automatically by this forum software (you won't include any html tags in your .htaccess file of course).

atul_iiit

8:44 pm on Aug 13, 2005 (gmt 0)

10+ Year Member



Thanks John,
So what html tag you are talking above.

Also Can I keep this .access file anywhere in server or on specific place like document root or ..

Also where can I get information about these things which you mentioned above like
%{HTTPS} on or [R=permanent,L]

jdMorgan

9:11 pm on Aug 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



atul_iiit,

Welcome to WebmasterWorld!

Start with our forum charter [webmasterworld.com], for information on how to get the most from this forum and for the reference documents cited at the end.

Jim