[Psi-devel] mod_rewrite

Hal Rottenberg halr9000 at gmail.com
Thu Dec 22 19:25:09 PST 2005


On 12/22/05, Hal Rottenberg <halr9000 at gmail.com> wrote:
> On 12/22/05, Yves Goergen <nospam.list at unclassified.de> wrote:
> > This looks as if you want to rewrite something matched to the query
> > string but I'm not sure Apache will look at that to match something. I
> > think you can only match directory and filename parts of the URL, so
> > anything before a "?".
>
> Guess I can do it with php...

Ok, everything is in place.  Review this please, it's the most
original (i.e. I didn't totally copy/paste) code I have ever written
nd it took me an hour.  :)

	$me = $_SERVER["REQUEST_URI"];
	$oldURL = 'psi.affinix.com';
	$pos = strpos($me,$oldURL);
	if($pos==TRUE) {
		header ("Location: /$page");
		header("Status: 301");
	}


Test the links and the redirects and the URLs you see in the browser
etc.  I think I covered all the bases.

--
Psi webmaster (http://psi-im.org)
im:hal at jabber.rocks.cc
http://halr9000.com


More information about the psi-devel mailing list