From owner-freebsd-questions@FreeBSD.ORG Tue May 4 13:17:07 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C3A61065676 for ; Tue, 4 May 2010 13:17:07 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (ns0.infracaninophile.co.uk [81.187.76.162]) by mx1.freebsd.org (Postfix) with ESMTP id D1B908FC19 for ; Tue, 4 May 2010 13:17:06 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.187.76.163]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.4/8.14.4) with ESMTP id o44DGKkZ031866 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 4 May 2010 14:16:21 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) Message-ID: <4BE01E24.4070503@infracaninophile.co.uk> Date: Tue, 04 May 2010 14:16:20 +0100 From: Matthew Seaman Organization: Infracaninophile User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Chris Maness References: In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.96 at happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_ADSP_ALL, SPF_FAIL autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on happy-idiot-talk.infracaninophile.co.uk Cc: freebsd-questions@freebsd.org Subject: Re: Apache URL Redirect? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 May 2010 13:17:07 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 03/05/2010 21:09:26, Chris Maness wrote: > I while back, I set up a podcast using wordpress. I did not use any > special configuration, I just added the files as media, and the > podcast software picked up the mp3's. However, now I would like to > use a podcast plugin that adds all of the correct itunes tags. > However, this changes the RSS URL from: > > http://podcast.rccoc.org/?feed=rss2 > > to: > > http://podcast.rccoc.org/?feed=podcast > > I have tried playing with some directives like: > > Redirect permanent /one http://example.com/two > > but they did not seem to work. I need apache to return 301 and the new URL. > > Any Ideas? You can do this with mod_rewrite. You'll need to use rewrite conditions, as usually URL arguments are not considered. See: http://httpd.apache.org/docs/2.2/rewrite/ for guidance, but something like this: RewriteEngine on RewriteCond %{QUERY_STRING} feed=rss2 RewriteRule ^$ /?feed=podcast [R=301] which redirects requests for feed=rss2 to feed=podcast -- I think that's what you're trying to do, but I could have it backwards, in which case just swap over the appropriate strings in the obvious way. Untested, but you should be able to get the idea. Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkvgHiQACgkQ8Mjk52CukIyXBQCfax2bvVOP0PUE8zE+dW391+qB I0cAn0LSyaSAFezgO5gGQQKROwDsc3Uy =iNJR -----END PGP SIGNATURE-----