[pmwiki-users] .htaccess redirect help

H. Fox haganfox at users.sourceforge.net
Sun Aug 5 17:39:53 CDT 2007


On 8/5/07, Kathryn Andersen <kat_lists at katspace.homelinux.org> wrote:
> I must admit I solved that problem for one of my sites in a simpler way.
> Rather than using .htaccess, I made an "index.cgi" which redirected
> people to the wiki.
>
> As follows:
> -----------------------------------------------------
> #!/bin/bash
> # Redirect users to the Wiki
>
> cat <<EOF
> Status: 302 Relocate status
> Location: /wiki/
> Content-type: text/html
>
> <html>
> <head>
> <title>Moved Home Page</title>
> </head>
> <body>
> <h1>We've Moved</h1>
> <p><a href="/wiki/">Main Page</a>.</p>
> </body>
> </html>
> EOF
> -----------------------------------------------------

Tranlated into PHP (index.php), with a few tweaks:
-----------------------------------------------------
<?php
# Redirect users to the Wiki
Header("Content-type: text/html");
Header("Status: 302 Moved");
Header("Location: http://vinylagain.com/pmwiki/pmwiki/pmwiki.php");
echo <<<EOT
<html>
<head>
<title>Moved Home Page</title>
</head>
<body>
<h1>We've Moved</h1>
<p><a href="http://vinylagain.com/pmwiki/pmwiki/pmwiki.php">
Main Page</a>.</p>
</body>
</html>
EOT;
-----------------------------------------------------

Hagan



More information about the pmwiki-users mailing list