Forum Moderators: coopster
I have php pages that urls started like: /album.php?user=455
I have htaccess rewritten & redirected them to: /mypics-455.htm
now, in the script I added extra variables to the internal urls to produce: /mypics-455-frogz.htm , The htaccess rewrite and everything is fine, but, "-frogz" is only served up in the url when an internal link is requested. Therefore, when a search engine requests the old link: album.php?user=455 , i cannot get it to redirect to:/mypics-455-frogz.htm, only:/mypics-455-.htm (name is missing)
How can I get the page requested to parse the url and add "$" when necessary?
function daPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
i need to make sure $_SERVER["REQUEST_URI"] has a variable in it before passed to the browser. there a way I can force a suffix to each page? so page /album-user-4.html returns: /album-user-4<added $$$$$>.html
in each page? something like:
$_SERVER["REQUEST_URI"]."added suffix"; my apologies for not being clear enough.
thnx in advance.
$_SERVER["REQUEST_URI"]."-".$userid; the page requested looks like: /album.php?userid=44
I have mod_rewrite rewriting the url to: /album-44.htm
I added extra parameters to the internal links that now when clicked will look like: /album-44-frogz.htm
<a href="album-$num-$id.htm"></a> thanx for all your help.
You should get to start to finish in just one hop. That is, multiple hops - a redirection chain - should always be avoided.
Check with both www and non-www inputs. All should result in just one hop, not a chain.