is the Final Product of what i was able to do with my script + .htaccess
Its a combanation of
htacess
[text]
RewriteRule ^(.*)/(.*).htm$ $1/index.php?page=$2 [L]
[/text]
php script
Code: Select all
<?php
require_once( dirname(__FILE__) . '/_config.php');
if(!isset($_GET['page'])):
header("HTTP/1.1 301 Moved Permanently");
header("Location: 1.htm");
exit();
endif;
$page = preg_replace("@[^0-9]@", "", $_GET['page']);
}to http://www.myspace-help.com/Myspace-Backgrounds1.htm
This is the whole code section of the script if it helps.
Code: Select all
<?php
require_once( dirname(__FILE__) . '/_config.php');
if(!isset($_GET['page'])):
header("HTTP/1.1 301 Moved Permanently");
header("Location: 1.htm");
exit();
endif;
$page = preg_replace("@[^0-9]@", "", $_GET['page']);
$_dir = end(explode('/', $start));
$_cache = 'categories';
if($_caching_on == 1){
require_once( dirname(__FILE__) . '/_encoded/cache_head.php');
}
else{
require_once( $_path . '/_inc/_encoded/'.$_cache.'.php');
if( $page > $pages ):
header("HTTP/1.1 301 Moved Permanently");
header("Location: 1.htm");
exit();
endif;
}
$_rep = array('-'=>' ','_'=>' ','1'=>'','2'=>'','3'=>'','4'=>'','5'=>'','6'=>'','7'=>'','8'=>'','9'=>'');
$tags = ucwords(trim(strtr(current($SliceArr), $_rep))).', ';
$total = (count($SliceArr)-1);
for($i=0; $i<$total; $i++){
if($i != ($total - 1)){
$tags .= ucwords(trim(strtr(next($SliceArr), $_rep))).', ';
}else{
$tags .= ucwords(trim(strtr(next($SliceArr), $_rep)));
}
}
include( $_path . '/_theme/header.php');
echo '<h1>'.$_dir.' Category </h1>'."\n";
echo '<div id="play">'."\n";
if(file_exists('before.php')) include('before.php');
foreach($SliceArr as $OBJ):
$name = ucwords(trim(strtr($OBJ, $_rep)));
if(file_exists($_path.'/'.$_dir.'/'.$OBJ.'/thumb.jpg')){
$THUMB = 'thumb.jpg';
}
elseif(file_exists($_path.'/'.$_dir.'/'.$OBJ.'/thumb.png')){
$THUMB = 'thumb.png';
}
elseif(file_exists($_path.'/'.$_dir.'/'.$OBJ.'/thumb.gif')){
$THUMB = 'thumb.gif';
}
echo
'<div id="cata" class="'.$_dir.'_category">'."\n".
'<p class="'.$_dir.'_category_title"><h2>'.$name.'</h2></p>'."\n".
'<a href="'.$_url.'/'.$_dir.'/'.$OBJ.'/"><img src="'.$_url.'/'.$_dir.'/'.$OBJ.'/'.$THUMB.'" border="0" class="nude"/></a>'."\n".
'</div>'."\n";
endforeach;
$num = 1;
echo
'</div>'."\n".
'<div id="pnav">'."\n".
'<span id="pages">Pages:</span> '."\n";
while( $num <= $pages ):
if($page != $num)
echo '<a href="'.$num.'.htm" class="pnum">'.$num.'</a>'."\n";
elseif($page == $num)
echo $num."\n";
$num++;
endwhile;
echo '</div>'."\n";
if(file_exists('after.php')) include('after.php');
include( $_path . '/_theme/footer.php');
if($_caching_on == 1){
require_once( dirname(__FILE__) . '/_encoded/cache_foot.php');
}
?>
And my current htacess
[text]Options -Indexes
Options +FollowSymLinks
DirectoryIndex index.php
RewriteEngine on
RewriteRule ^(.*)/(.*).htm$ $1/index.php?page=$2 [L]
RewriteRule ^(.*)/(.*)/(.*).htm$ $1/2$/index.php?page=$3 [L]
ErrorDocument 404 /404.php
<ifModule mod_php5.c>
php_value default_charset utf-8
</ifModule>[/text]
Ill be on the forums all day reading up on it and checking out new stuff but if you want to msg me on msn it is Calm.to.catastrophe@gmail.com