datoshway Posted April 30, 2010 Share Posted April 30, 2010 I'm looking for a way to have a page only be forwarded if it's accessed directly. The reason i'm doing this is because I have files my site loads but search engines are also displaying them, while I want search engines to use them for content I don't want them displayed. So I was thinking if there was a good way to have a script only forward if it's accessed directly. Any ideas? Link to comment https://forums.phpfreaks.com/topic/200327-forward-script-question/ Share on other sites More sharing options...
ChemicalBliss Posted May 1, 2010 Share Posted May 1, 2010 Your explanation is a little confusing, can you give us an example? ie, I only want spiders to crawl index.php, and not somepage.html etc. -cb- Link to comment https://forums.phpfreaks.com/topic/200327-forward-script-question/#findComment-1051314 Share on other sites More sharing options...
datoshway Posted May 1, 2010 Author Share Posted May 1, 2010 Well I am using jquery to call my content pages, they don't have the full website frame. SO when those pages are displayed in google searches you just get the content. I oviously want these pages to be used as content for google, so i'm wondering if you or anyone knows of a script that would make it so if that content page is accessed directly it would forward you to the correct link, putting noindex is now the page and content is not being used for SEO purposes. Link to comment https://forums.phpfreaks.com/topic/200327-forward-script-question/#findComment-1051318 Share on other sites More sharing options...
ChemicalBliss Posted May 1, 2010 Share Posted May 1, 2010 If the content is stored in .php, you could simply add an argument to the script that jquery needs to pass, eg: JQuery Request URL: somecontent.php?nospider=true in each file: if(!isset($_GET['nospider']) || $_GET['nospider'] != 'true'){ Header('Location: index.php?page=somecontent'); } -cb- Link to comment https://forums.phpfreaks.com/topic/200327-forward-script-question/#findComment-1051323 Share on other sites More sharing options...
datoshway Posted May 1, 2010 Author Share Posted May 1, 2010 If the content is stored in .php, you could simply add an argument to the script that jquery needs to pass, eg: JQuery Request URL: somecontent.php?nospider=true in each file: if(!isset($_GET['nospider']) || $_GET['nospider'] != 'true'){ Header('Location: index.php?page=somecontent'); } -cb- Interesting! I'll give it a try. Thanks! Link to comment https://forums.phpfreaks.com/topic/200327-forward-script-question/#findComment-1051325 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.