is the Final Product of what i was able to do with my script + .htaccess
Its a combanation of
htacess
RewriteRule ^(.*)/(.*).htm$ $1/index.php?page=$2 [L]
php script
<?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']);
}
How do i properly turn what is normally http://www.myspace-help.com/Myspace-backgrounds/?=page1
to http://www.myspace-help.com/Myspace-Backgrounds1.htm
This is the whole code section of the script if it helps.
<?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>'."\
";
echo '<div id="play">'."\
";
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">'."\
".
'<p class="'.$_dir.'_category_title"><h2>'.$name.'</h2></p>'."\
".
'<a href="'.$_url.'/'.$_dir.'/'.$OBJ.'/"><img src="'.$_url.'/'.$_dir.'/'.$OBJ.'/'.$THUMB.'" border="0" class="nude"/></a>'."\
".
'</div>'."\
";
endforeach;
$num = 1;
echo
'</div>'."\
".
'<div id="pnav">'."\
".
'<span id="pages">Pages:</span> '."\
";
while( $num <= $pages ):
if($page != $num)
echo '<a href="'.$num.'.htm" class="pnum">'.$num.'</a>'."\
";
elseif($page == $num)
echo $num."\
";
$num++;
endwhile;
echo '</div>'."\
";
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
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>
I Spent two days changing variables in each section, the htacess and the php script but to no avail.
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 <snip/>