mod_rewrite...https index page -> http index page

mod_rewrite...https index page -> http index page

am 01.12.2009 14:36:55 von John Corry

--00235429d3dcf6f62f0479aad9e5
Content-Type: text/plain; charset=ISO-8859-1

My apologies, this is not strictly PHP...but it is relevant to a great
number of PHP application frameworks that many of us use or will use.

I have a Magento installation that relies heavily on mod_rewrite. For the
most part, I have all of my canonical URLs worked out, minus one issue.

How do I make sure that https:// requests for / are redirected to http:// /
?

I've got a rule already that strips the index.php off of requests, so I
don't want to check for that...just want to check for requests for the
https:// version of my root home page and redirect to the non-secure
version.

I suck with regex and all of my attempts to modify examples I've found have
failed.
--
John Corry
PHP developer - 3by400, Inc
http://www.3by400.com

--00235429d3dcf6f62f0479aad9e5--

Re: mod_rewrite...https index page -> http index page

am 01.12.2009 14:58:31 von Kim Emax

--0016e65b5e043927490479ab279a
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hey John

2009/12/1 John Corry

> My apologies, this is not strictly PHP...but it is relevant to a great
> number of PHP application frameworks that many of us use or will use.
>

Well, still, you should ask in an apache forum :-)

I have a Magento installation that relies heavily on mod_rewrite. For the
> most part, I have all of my canonical URLs worked out, minus one issue.
>
> How do I make sure that https:// requests for / are redirected to http://=
/
> ?
>

I=B4ve once solved that by the virtualhost block (http://webmail var direct=
ed
to https://webmail)



> I've got a rule already that strips the index.php off of requests, so I
> don't want to check for that...just want to check for requests for the
> https:// version of my root home page and redirect to the non-secure
> version.
>
> I suck with regex and all of my attempts to modify examples I've found ha=
ve
> failed.
>

well, ^means start of line, but the rewrites I=B4ve got examples of and are
using at work says ^admin so that=B4s cleary the query_string, not the enti=
re
URL. (I haven=B4t used mod_rewite at all until this week...)

And as I see it nothing come close to what you want here:
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html, so maybe it=B4s no=
t
possible?

or you do this: RewriteRule ^(.*)$ https://yoursite.com$1

This should catch everything in the query_string and save it in $1, maybe
that works?


Kind regards
Kim

--0016e65b5e043927490479ab279a--