Jump to content

PHP redirect


Brad420

Recommended Posts

I am building a new site, and they want to keep the links to their old .htm pages active for SEO reasons.

What I did was created multiple .htm files that use this code.

 

Like this...

 

<?

header("HTTP/1.1 301 Moved Permanently");

header("Location: ../Charity%20Auctioneer%20Info");

?>

 

The problem I am having is it only works for one link. I did the same thing with the other links using the same code,but it doesn't have the same effect.

 

Is this because the headers were already sent? If so is there a way around it?

Link to comment
https://forums.phpfreaks.com/topic/124262-php-redirect/
Share on other sites

for that to work the pages have to be a .php page.

 

try the following:

 

<script language='JAVASCRIPT' type='TEXT/JAVASCRIPT'>

<!--

if ((navigator.appName=="Microsoft Internet Explorer") || (navigator.appName=="Netscape"))

{

if (navigator.appName=="Microsoft Internet Explorer")

window.location = "YOUR PAGE HERE";

else

window.location = "YOUR PAGE HERE";

}

else

window.location = "YOUR PAGE HERE";

//--></script>

Link to comment
https://forums.phpfreaks.com/topic/124262-php-redirect/#findComment-641678
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.