Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 May 2010 14:16:20 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Chris Maness <chris@chrismaness.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Apache URL Redirect?
Message-ID:  <4BE01E24.4070503@infracaninophile.co.uk>
In-Reply-To: <AANLkTim8rsrOOr9fbo3KudAyBUdTMmJOyzXHg6evt6Xz@mail.gmail.com>
References:  <AANLkTim8rsrOOr9fbo3KudAyBUdTMmJOyzXHg6evt6Xz@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----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-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BE01E24.4070503>