Jump to content

Forward Script Question


datoshway

Recommended Posts

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

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.

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-

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!

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.