This may help. This was taken from googlifier.
This is the code for the phpNuke port.
header.php
<?php
if (eregi("header.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
ob_start();
function replace_for_mod_rewrite(&$s) {
$urlin = array(
"'(?<!/)gate.html\?name=(coppermine\")'",
"'(?<!/)gate.html\?name=coppermine&file=displayimage&album=([a-zA-Z]*)&cat=-([0-9]*)&pos=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=displayimage&album=([0-9]*)&pos=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=displayimage&album=([a-zA-Z]*)&cat=&pos=-([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=displayimage&album=([a-zA-Z]*)&cat=&pos=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=displayimage&album=([a-zA-Z]*)&cat=([0-9]*)&pos=-([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=displayimage&album=([a-zA-Z]*)&cat=([0-9]*)&pos=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=thumbnails&album=([a-zA-Z]*)&cat=-([0-9]*)&page=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=thumbnails&album=([a-zA-Z]*)&cat=-([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=thumbnails&album=([a-zA-Z]*)&cat=([0-9]*)&page=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=thumbnails&album=([a-zA-Z]*)&cat=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=thumbnails&album=([0-9]*)&page=([0-9]*)&sort=([a-z]*)'",
"'(?<!/)gate.html\?name=coppermine&file=thumbnails&album=([0-9]*)&page=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=thumbnails&album=([0-9a-zA-Z]*)'",
"'(?<!/)gate.html\?name=coppermine&file=profile&uid=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&cat=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=index'",
);
$urlout = array(
"photogallery.html\"",
"image_\\1-\\2-\\3.html",
"image_\\1-\\2.html",
"image-\\1-\\2.html",
"image_\\1-\\2.html",
"image-\\1-\\2-\\3.html",
"image_\\1\\2-\\3.html",
"gallery-\\1-\\2-\\3.html",
"gallery-\\1-\\2.html",
"gallery_\\1-\\2-\\3.html",
"gallery_\\1-\\2.html",
"gallery_\\1-\\2-\\3.html",
"gallery_\\1-\\2.html",
"gallery_\\1.html",
"gallery_user-\\1.html",
"user_galleries-\\1.html",
"gallery.html"
);
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
require_once("mainfile.php");
$header = 1;
function head() {
global $slogan, $sitename, $banners, $nukeurl, $Version_Num, $artpage, $topic, $hlpfile, $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $forumpage, $adminpage, $userpage, $pagetitle;
$ThemeSel = get_theme();
include("themes/$ThemeSel/theme.php");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n";
echo "<head>\n";
echo "<title>$sitename $pagetitle</title>\n";
include("includes/meta.php");
include("includes/javascript.php");
if (file_exists("themes/$ThemeSel/images/favicon.ico")) {
echo "<link REL=\"shortcut icon\" HREF=\"themes/$ThemeSel/images/favicon.ico\" TYPE=\"image/x-icon\">\n";
}
echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n\n\n";
include("includes/my_header.php");
echo "\n\n\n</head>\n\n";
themeheader();
}
online();
head();
include("includes/counter.php");
global $home;
if ($home == 1) {
message_box();
blocks(Center);
}
?>
.htaccess
DirectoryIndex index.php index.cgi index.pl index.shtml index.html
<Limit GET PUT POST>
order allow,deny
allow from all
</Limit>
# deny most common except .php
<FilesMatch "\.(inc|tpl|h|ihtml|sql|ini|conf|class|bin|spd|theme|module|exe)$">
deny from all
</FilesMatch>
#Disable .htaccess viewing from browser
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</Files>
<Files ~ "\config.php$">
deny from all
</Files>
# change to yoursite.com
ErrorDocument 404 http://www.lbd1956.com/index.html
RewriteEngine On
RewriteRule ^index.html index.php
RewriteRule ^gate.* modules.php
#Coppermine
RewriteRule ^image_([a-zA-Z]*)-([0-9]*)-([0-9]*).html gate.html?name=coppermine&file=displayimage&album=$1&cat=-$2&pos=$3
RewriteRule ^image_([0-9]*)-([0-9]*).html gate.html?name=coppermine&file=displayimage&album=$1&pos=$2
RewriteRule ^image-([a-zA-Z]*)-([0-9]*).html gate.html?name=coppermine&file=displayimage&album=$1&cat=&pos=-$2
RewriteRule ^image_([a-zA-Z]*)-([0-9]*).html gate.html?name=coppermine&file=displayimage&album=$1&cat=&pos=$2
RewriteRule ^image-([a-zA-Z]*)-([0-9]*)-([0-9]*).html gate.html?name=coppermine&file=displayimage&album=$1&cat=$2&pos=-$3
RewriteRule ^image_([a-zA-Z]*)([0-9]*)-([0-9]*).html gate.html?name=coppermine&file=displayimage&album=$1&cat=$2&pos=$3
RewriteRule ^gallery-([a-zA-Z]*)-([0-9]*)-([0-9]*).html gate.html?name=coppermine&file=thumbnails&album=$1&cat=-$2&page=$3
RewriteRule ^gallery-([a-zA-Z]*)-([0-9]*).html gate.html?name=coppermine&file=thumbnails&album=$1&cat=-$2
RewriteRule ^gallery_([a-zA-Z]*)-([0-9]*)-([0-9]*).html gate.html?name=coppermine&file=thumbnails&album=$1&cat=$2&page=$3
RewriteRule ^gallery_([a-zA-Z]*)-([0-9]*).html gate.html?name=coppermine&file=thumbnails&album=$1&cat=$2
RewriteRule ^gallery_([0-9]*)-([0-9]*)-([a-z]*).html gate.html?name=coppermine&file=thumbnails&album=$1&page=$2&sort=$3
RewriteRule ^gallery_([0-9]*)-([0-9]*).html gate.html?name=coppermine&file=thumbnails&album=$1&page=$2
RewriteRule ^gallery_([0-9a-zA-Z]*).html gate.html?name=coppermine&file=thumbnails&album=$1
RewriteRule ^gallery_user-([0-9]*).html gate.html?name=coppermine&file=profile&uid=$1
RewriteRule ^user_galleries-([0-9]*).html gate.html?name=coppermine&cat=$1
RewriteRule ^gallery.html gate.html?name=coppermine&file=index