Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EED31EBAF for ; Mon, 11 Feb 2013 00:46:56 +0000 (UTC) Received: (qmail 6191 invoked by uid 500); 11 Feb 2013 00:46:52 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 6145 invoked by uid 500); 11 Feb 2013 00:46:52 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 6134 invoked by uid 99); 11 Feb 2013 00:46:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Feb 2013 00:46:52 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of andrew@computersforall.com.au designates 213.199.154.206 as permitted sender) Received: from [213.199.154.206] (HELO am1outboundpool.messaging.microsoft.com) (213.199.154.206) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Feb 2013 00:46:43 +0000 Received: from mail62-am1-R.bigfish.com (10.3.201.246) by AM1EHSOBE026.bigfish.com (10.3.207.148) with Microsoft SMTP Server id 14.1.225.23; Mon, 11 Feb 2013 00:46:20 +0000 Received: from mail62-am1 (localhost [127.0.0.1]) by mail62-am1-R.bigfish.com (Postfix) with ESMTP id 7299D1600E4 for ; Mon, 11 Feb 2013 00:46:20 +0000 (UTC) X-Forefront-Antispam-Report: CIP:111.221.116.165;KIP:(null);UIP:(null);IPV:NLI;H:SIXPRD0310HT005.apcprd03.prod.outlook.com;RD:none;EFVD:NLI X-SpamScore: -2 X-BigFish: PS-2(z564cozbb2dI98dI9371Ic85fh103dKfecI111aI14ffIzz1f42h1ee6h1de0h1d18h1202h1e76h1d1ah1d2ahzz17326ah8275bh8275dh18c673h1954cbh18602ehz2fh2a8h668h839hd25hf0ah1288h12a5h12bdh137ah1441h1504h1537h153bh15d0h162dh1631h1758h18e1h1946h19b5h19ceh1155h) Received-SPF: pass (mail62-am1: domain of computersforall.com.au designates 111.221.116.165 as permitted sender) client-ip=111.221.116.165; envelope-from=andrew@computersforall.com.au; helo=SIXPRD0310HT005.apcprd03.prod.outlook.com ;.outlook.com ; Received: from mail62-am1 (localhost.localdomain [127.0.0.1]) by mail62-am1 (MessageSwitch) id 1360543575745059_29167; Mon, 11 Feb 2013 00:46:15 +0000 (UTC) Received: from AM1EHSMHS015.bigfish.com (unknown [10.3.201.252]) by mail62-am1.bigfish.com (Postfix) with ESMTP id B3D22120061 for ; Mon, 11 Feb 2013 00:46:15 +0000 (UTC) Received: from SIXPRD0310HT005.apcprd03.prod.outlook.com (111.221.116.165) by AM1EHSMHS015.bigfish.com (10.3.207.153) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 11 Feb 2013 00:46:15 +0000 Received: from SIXPRD0310MB358.apcprd03.prod.outlook.com ([169.254.2.23]) by SIXPRD0310HT005.apcprd03.prod.outlook.com ([10.255.22.168]) with mapi id 14.16.0263.000; Mon, 11 Feb 2013 00:46:13 +0000 From: Andrew White To: "users@httpd.apache.org" Thread-Topic: [users@httpd] Rewrite rules not working Thread-Index: Ac4FimHeafvRUmOgRF+hI+bFOnCrYgAAPKSAABsFfAAAe8jnEAAA+OiAAAFyD5A= Date: Mon, 11 Feb 2013 00:46:13 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-AU, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [59.167.191.96] Content-Type: multipart/alternative; boundary="_000_C2A9E5A705B4B24785AD3A18141650072A759B39SIXPRD0310MB358_" MIME-Version: 1.0 X-OriginatorOrg: computersforall.com.au X-Virus-Checked: Checked by ClamAV on apache.org Subject: RE: [users@httpd] Rewrite rules not working --_000_C2A9E5A705B4B24785AD3A18141650072A759B39SIXPRD0310MB358_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hey Igor, Thanks for that. I've turned it on and I think I've identified the problem, however I still = can't quite find a fix. In the logs if I am using my original condition/rul= e and use mysite.com.au/test I see the following: 10.1.1.1 - - [11/Feb/2013:11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#= b847d100/initial] (3) [perdir /home/website/public_html/] strip per-dir pre= fix: /home/website/public_html/test -> test 10.1.1.1 - - [11/Feb/2013:11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#= b847d100/initial] (3) [perdir /home/website/public_html/] applying pattern = '^(.+)$' to uri 'test' 10.1.1.1 - - [11/Feb/2013:11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#= b847d100/initial] (3) [perdir /home/website/public_html/] strip per-dir pre= fix: /home/website/public_html/test -> test 10.1.1.1 - - [11/Feb/2013:11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#= b847d100/initial] (3) [perdir /home/website/public_html/] applying pattern = '^(.+)$' to uri 'test' 10.1.1.1 - - [11/Feb/2013:11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#= b847d100/initial] (3) [perdir /home/website/public_html/] strip per-dir pre= fix: /home/website/public_html/test -> test 10.1.1.1 - - [11/Feb/2013:11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#= b847d100/initial] (3) [perdir /home/website/public_html/] applying pattern = '^(.*)$' to uri 'test' 10.1.1.1 - - [11/Feb/2013:11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#= b847d100/initial] (2) [perdir /home/website/public_html/] rewrite 'test' ->= 'http://www.mysite.com.au/test' 10.1.1.1 - - [11/Feb/2013:11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#= b847d100/initial] (2) [perdir /home/website/public_html/] explicitly forcin= g redirect with http://www.mysite.com.au/test However when I run it against just mysite.com.au I see: 10.1.1.1 - - [11/Feb/2013:11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#= b845bc18/initial] (3) [perdir /home/website/public_html/] strip per-dir pre= fix: /home/website/public_html/ -> 10.1.1.1 - - [11/Feb/2013:11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#= b845bc18/initial] (3) [perdir /home/website/public_html/] applying pattern = '^(.+)$' to uri '' 10.1.1.1 - - [11/Feb/2013:11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#= b845bc18/initial] (3) [perdir /home/website/public_html/] strip per-dir pre= fix: /home/website/public_html/ -> 10.1.1.1 - - [11/Feb/2013:11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#= b845bc18/initial] (3) [perdir /home/website/public_html/] applying pattern = '^(.+)$' to uri '' 10.1.1.1 - - [11/Feb/2013:11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#= b845bc18/initial] (3) [perdir /home/website/public_html/] strip per-dir pre= fix: /home/website/public_html/ -> 10.1.1.1 - - [11/Feb/2013:11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#= b845bc18/initial] (3) [perdir /home/website/public_html/] applying pattern = '^(.*)$' to uri '' 10.1.1.1 - - [11/Feb/2013:11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#= b845bc18/initial] (2) [perdir /home/website/public_html/] rewrite '' -> ':/= /www.mysite.com.au/' 10.1.1.1 - - [11/Feb/2013:11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#= b845bc18/initial] (3) [perdir /home/website/public_html/] add per-dir prefi= x: ://www.mysite.com.au/ -> /home/website/public_html/://www.mysite.com.au/ 10.1.1.1 - - [11/Feb/2013:11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#= b845bc18/initial] (2) [perdir /home/website/public_html/] explicitly forcin= g redirect with http:/.makeitmine.com.au/home/website/public_html/://www.my= site.com.au/ Note that the environment variable I'm trying to set (SSL on/off) isn't bei= ng set. As such, it's not seeing the http/https prefix and assuming it's a = relative internal path! When I'm trying to set the environment variable, I use the following code: RewriteCond %{HTTPS} =3Don RewriteRule ^(.+)$ - [env=3Dps:https] RewriteCond %{HTTPS} !=3Don RewriteRule ^(.+)$ - [env=3Dps:http] The RegEx of ^(.+)$ expects a minimum of 1 character, which there is not to= match! I modified it as follows: RewriteCond %{HTTPS} =3Don RewriteRule ^(.*)$ - [env=3Dps:https] RewriteCond %{HTTPS} !=3Don RewriteRule ^(.*)$ - [env=3Dps:http] And now it matches, even on 0 characters! Thanks again for your help, problem solved :) 10.1.1.1 - - [11/Feb/2013:11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#= b8478208/initial] (3) [perdir /home/website/public_html/] strip per-dir pre= fix: /home/website/public_html/ -> 10.1.1.1 - - [11/Feb/2013:11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#= b8478208/initial] (3) [perdir /home/website/public_html/] applying pattern = '^(.*)$' to uri '' 10.1.1.1 - - [11/Feb/2013:11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#= b8478208/initial] (3) [perdir /home/website/public_html/] strip per-dir pre= fix: /home/website/public_html/ -> 10.1.1.1 - - [11/Feb/2013:11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#= b8478208/initial] (3) [perdir /home/website/public_html/] applying pattern = '^(.*)$' to uri '' 10.1.1.1 - - [11/Feb/2013:11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#= b8478208/initial] (3) [perdir /home/website/public_html/] strip per-dir pre= fix: /home/website/public_html/ -> 10.1.1.1 - - [11/Feb/2013:11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#= b8478208/initial] (3) [perdir /home/website/public_html/] applying pattern = '^(.*)$' to uri '' 10.1.1.1 - - [11/Feb/2013:11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#= b8478208/initial] (2) [perdir /home/website/public_html/] rewrite '' -> 'ht= tp://www.mysite.com.au/' 10.1.1.1 - - [11/Feb/2013:11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#= b8478208/initial] (2) [perdir /home/website/public_html/] explicitly forcin= g redirect with http://www.mysite.com.au/ From: Igor Cicimov [mailto:icicimov@gmail.com] Sent: Monday, 11 February 2013 10:58 AM To: users Subject: RE: [users@httpd] Rewrite rules not working RewriteLog i think was the statement but please check the docs too On 11/02/2013 10:34 AM, "Andrew White" > wrote: Hi Igor, Thanks for your help, but this doesn't seem to work. >From a bit of testing, it looks like the RewriteRule starting with "/" simp= ly doesn't catch anything. Any other ideas? Or are there any logs I can check/set up for mod_rewrite? Thanks all! Andrew From: Igor Cicimov [mailto:icicimov@gmail.com] Sent: Friday, 8 February 2013 11:26 PM To: users Subject: Re: [users@httpd] Rewrite rules not working On Fri, Feb 8, 2013 at 10:51 AM, Andrew White > wrote: Hi all, I've been writing a rewrite rule to try and redirect all of our traffic fro= m mysite.com.au to www.mysite.com.au. I also need to conditionally redirect depending on SSL enabled o= r not. I've hacked on a bit from askapache.com to create a variable that holds either= http or https dependently. Below is the code I'm using: RewriteCond %{HTTPS} =3Don RewriteRule ^(.+)$ - [env=3Dps:https] RewriteCond %{HTTPS} !=3Don RewriteRule ^(.+)$ - [env=3Dps:http] RewriteCond %{HTTP_HOST} ^mysite\.com\.au(.*)$ [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^(.*)$ %{ENV:ps}://www.mysite.com.au/$1 [L,R=3D301] This works fine for URLs with paths (e.g. mysite.com.au/foo redirects to www.mysite.com.au/foo= ) and does the http and https switch fine. However when just accessing the domain (just mysite.com.au) it redirects tohttp://www.mysite.com.au/home/website/public_html/:/w= ww.mysite.com.au/ I'm sure it's something very small and basic I'm missing - if someone could= point it out, that'd be appreciated. Thanks! Andrew Try this way RewriteCond %{HTTP_HOST} ^mysite\.com\.au$ [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/(.*)$ %{ENV:ps}://www.mysite.com.au/$1 [L,R=3D301] --_000_C2A9E5A705B4B24785AD3A18141650072A759B39SIXPRD0310MB358_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hey Igor,

 <= /p>

Thanks for that.

 <= /p>

I’ve turned it on a= nd I think I’ve identified the problem, however I still can’t q= uite find a fix. In the logs if I am using my original condition/rule and use mysite.com.au/test I see the following:

 <= /p>

10.1.1.1 - - [11/Feb/2013= :11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#b847d100/initial] (3)= [perdir /home/website/public_html/] strip per-dir prefix: /home/website/pu= blic_html/test -> test

10.1.1.1 - - [11/Feb/2013= :11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#b847d100/initial] (3)= [perdir /home/website/public_html/] applying pattern '^(.+)$' to uri 'test'

10.1.1.1 - - [11/Feb/2013= :11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#b847d100/initial] (3)= [perdir /home/website/public_html/] strip per-dir prefix: /home/website/pu= blic_html/test -> test

10.1.1.1 - - [11/Feb/2013= :11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#b847d100/initial] (3)= [perdir /home/website/public_html/] applying pattern '^(.+)$' to uri 'test'

10.1.1.1 - - [11/Feb/2013= :11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#b847d100/initial] (3)= [perdir /home/website/public_html/] strip per-dir prefix: /home/website/pu= blic_html/test -> test

10.1.1.1 - - [11/Feb/2013= :11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#b847d100/initial] (3)= [perdir /home/website/public_html/] applying pattern '^(.*)$' to uri 'test'

10.1.1.1 - - [11/Feb/2013= :11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#b847d100/initial] (2)= [perdir /home/website/public_html/] rewrite 'test' -> 'http://www.mysit= e.com.au/test'

10.1.1.1 - - [11/Feb/2013= :11:37:50 +1100] [mysite.com.au/sid#b81d24f8][rid#b847d100/initial] (2)= [perdir /home/website/public_html/] explicitly forcing redirect with http://www.mysite.com.au/te= st

 <= /p>

However when I run it aga= inst just mysite.com.au I see:

 <= /p>

10.1.1.1 - - [11/Feb/2013= :11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#b845bc18/initial] (3)= [perdir /home/website/public_html/] strip per-dir prefix: /home/website/pu= blic_html/ ->

10.1.1.1 - - [11/Feb/2013= :11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#b845bc18/initial] (3)= [perdir /home/website/public_html/] applying pattern '^(.+)$' to uri ''

10.1.1.1 - - [11/Feb/2013= :11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#b845bc18/initial] (3)= [perdir /home/website/public_html/] strip per-dir prefix: /home/website/pu= blic_html/ ->

10.1.1.1 - - [11/Feb/2013= :11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#b845bc18/initial] (3)= [perdir /home/website/public_html/] applying pattern '^(.+)$' to uri ''

10.1.1.1 - - [11/Feb/2013= :11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#b845bc18/initial] (3)= [perdir /home/website/public_html/] strip per-dir prefix: /home/website/pu= blic_html/ ->

10.1.1.1 - - [11/Feb/2013= :11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#b845bc18/initial] (3)= [perdir /home/website/public_html/] applying pattern '^(.*)$' to uri ''

10.1.1.1 - - [11/Feb/2013= :11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#b845bc18/initial] (2)= [perdir /home/website/public_html/] rewrite '' -> '://www.mysite.com.au= /'

10.1.1.1 - - [11/Feb/2013= :11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#b845bc18/initial] (3)= [perdir /home/website/public_html/] add per-dir prefix: ://www.mysite.com.= au/ -> /home/website/public_html/://www.mysite.com.au/

10.1.1.1 - - [11/Feb/2013= :11:38:16 +1100] [mysite.com.au/sid#b81d24f8][rid#b845bc18/initial] (2)= [perdir /home/website/public_html/] explicitly forcing redirect with http:/.makeitmine.com.au/home/website/public_html/://www.mysite.com.a= u/

 <= /p>

Note that the environment= variable I’m trying to set (SSL on/off) isn’t being set. As su= ch, it’s not seeing the http/https prefix and assuming it’s a r= elative internal path!

 <= /p>

When I’m trying to = set the environment variable, I use the following code:

 <= /p>

    &= nbsp;  RewriteCond %{HTTPS} =3Don

    &= nbsp;   RewriteRule ^(.+)$ - [env=3Dps:https]

    &= nbsp;   RewriteCond %{HTTPS} !=3Don

    &= nbsp;   RewriteRule ^(.+)$ - [env=3Dps:http]

 <= /p>

The RegEx of ^(.+)$ e= xpects a minimum of 1 character, which there is not to match! I modified it a= s follows:

 <= /p>

    &= nbsp;  RewriteCond %{HTTPS} =3Don

    &= nbsp;   RewriteRule ^(.*)$ - [env=3Dps:https]

    &= nbsp;   RewriteCond %{HTTPS} !=3Don

    &= nbsp;   RewriteRule ^(.*)$ - [env=3Dps:http]

 <= /p>

And now it matches, even = on 0 characters!

 <= /p>

Thanks again for your hel= p, problem solved :)

 <= /p>

10.1.1.1 - - [11/Feb/2013= :11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#b8478208/initial] (3)= [perdir /home/website/public_html/] strip per-dir prefix: /home/website/pu= blic_html/ ->

10.1.1.1 - - [11/Feb/2013= :11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#b8478208/initial] (3)= [perdir /home/website/public_html/] applying pattern '^(.*)$' to uri ''

10.1.1.1 - - [11/Feb/2013= :11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#b8478208/initial] (3)= [perdir /home/website/public_html/] strip per-dir prefix: /home/website/pu= blic_html/ ->

10.1.1.1 - - [11/Feb/2013= :11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#b8478208/initial] (3)= [perdir /home/website/public_html/] applying pattern '^(.*)$' to uri ''

10.1.1.1 - - [11/Feb/2013= :11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#b8478208/initial] (3)= [perdir /home/website/public_html/] strip per-dir prefix: /home/website/pu= blic_html/ ->

10.1.1.1 - - [11/Feb/2013= :11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#b8478208/initial] (3)= [perdir /home/website/public_html/] applying pattern '^(.*)$' to uri ''

10.1.1.1 - - [11/Feb/2013= :11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#b8478208/initial] (2)= [perdir /home/website/public_html/] rewrite '' -> 'http://www.mysite.co= m.au/'

10.1.1.1 - - [11/Feb/2013= :11:44:57 +1100] [mysite.com.au/sid#b81d24f8][rid#b8478208/initial] (2)= [perdir /home/website/public_html/] explicitly forcing redirect with http://www.mysite.com.au/

 <= /p>

From: Igor Cic= imov [mailto:icicimov@gmail.com]
Sent: Monday, 11 February 2013 10:58 AM
To: users
Subject: RE: [users@httpd] Rewrite rules not working

 

RewriteLog i think was the statement but please check the docs too<= /o:p>

On 11/02/2013 10:34 AM, "Andrew White" <= ;andrew@computersforall.co= m.au> wrote:

Hi Igor,

 

Thanks for your help, but this doesn= 217;t seem to work.

 

From a bit of testing, it looks like th= e RewriteRule starting with “/” simply doesn’t catch anyt= hing.

 

Any other ideas? Or are there any logs = I can check/set up for mod_rewrite?

 

Thanks all!

 

Andrew

 

From: Igor Cicimov [mailto:<= a href=3D"mailto:icicimov@gmail.com" target=3D"_blank">icicimov@gmail.com]
Sent: Friday, 8 February 2013 11:26 PM
To: users
Subject: Re: [users@httpd] Rewrite rules not working

 

 

 

On Fri, Feb 8, 2013 at 10:51 AM, Andrew White <andrew@computersforall.c= om.au> wrote:

Hi all,

I've been writing a rewrite rule to try and redirect all of our = traffic from mysite.com.au to www.mysite.com.au. I also need to conditionally redirect depending on S= SL enabled or not.

I've hacked on a bit from askapache.c= om to create a variable that holds either http or https dependently.= Below is the code I'm using:

 

    RewriteCond %{HTTPS} =3Don
    RewriteRu=
le ^(.+)$ - [env=3Dps:https]
    RewriteCo=
nd %{HTTPS} !=3Don
    RewriteRu=
le ^(.+)$ - [env=3Dps:http]
    RewriteCo=
nd %{HTTP_HOST} ^mysite\.com\.au(.*)$ [NC]
    RewriteCo=
nd %{HTTP_HOST} !^$
    RewriteRu=
le ^(.*)$ %{ENV:ps}://www.mysite.com.au/$1 [L,R=3D301]

 =

This works fine for URLs with paths (e.g. mysite.com.au/foo redirects to www.mysite.com.a= u/foo) and does the http and https switch fine.=

However when just accessing the domain (just mysite.com.au) it re= directs tohttp://www.mysite.com.au/home/website/publi= c_html/:/www.mysite.com.au/

I'm sure it's something very small and basic I'm missing - if so= meone could point it out, that'd be appreciated.

Thanks!

Andrew

 

Try this way

RewriteCond %{HTTP_HOST} ^my=
site\.com\.au$ [NC]
    RewriteCo=
nd %{HTTP_HOST} !^$
    RewriteRu=
le ^/(.*)$ %{ENV:ps}://www.mysite.com.au/$1 [L,R=3D301]

 

--_000_C2A9E5A705B4B24785AD3A18141650072A759B39SIXPRD0310MB358_--