Ok this may sound like an stupid question but i can't figure out how to reliably do an javascript redirect if (and only if) an subpage is called directly.
My website generates dynamic content so i created an sitemap to make everything accessible for search engines. Now if someone clicks on an search-engine hit, for example
example.com/getPage.php?page=14
an ugly (and invalid) html page shows off, since it's never meant to be viewed directly.
Is there any way to reliably redirect visitors to the main page? Checking for $HTTP_REFERER isn't the best solution, i guess.
My website generates dynamic content so i created an sitemap to make everything accessible for search engines. Now if someone clicks on an search-engine hit, for example
example.com/getPage.php?page=14
an ugly (and invalid) html page shows off, since it's never meant to be viewed directly.
Is there any way to reliably redirect visitors to the main page? Checking for $HTTP_REFERER isn't the best solution, i guess.