Forum Moderators: coopster

Message Too Old, No Replies

Black Hat or Not? Linking technique using PHP

Making a dynamic site SEO friendly, but is this the way to do it?

         

HitsChatter

2:23 pm on Aug 13, 2004 (gmt 0)

10+ Year Member



I had an idea that I wanted to see what people think of it. I'm optimizing a site that is already built w/ very generic file naming and directory structure. In other words, I don't have directories or file names that intentionally have keywords in them. For the most part, its just a lot of index.php and one-word names.

So now I'm trying to figure out a way to get some keyword URL's in there w/o trashing my directory structure.

Here's what I'm thinking:

Let's say I have a link already in the page that goes to index.php. What if I changed the link to keyword_term.php, then I put the following code in keyword_term.php:

<?php
$no_spider = "TRUE";
include "index.php";
?>

index.php would then have this in the header:

<?php
if ($no_spider = "TRUE") {
echo "<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">";
}
?>

I know it seems like more work than its worth, but the idea is that in the long run, I can optimize multiple pages for different keywords, while requiring little maintanence if I decide to edit the original index.php. I'm also using the $no_spider variable to aviod being penalized for duplicate content. My intention is not to get index.php indexed multiple times, just to allow other pages to link to it using different file names.

ergophobe

7:49 pm on Aug 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



An alternative would be to rename the files and paths, and set up redirects to the new ones. Then if you wanted multiple URLs for a given file, you could use the method you mentioned, which should work fine as long as your robots exclusion works to prevent you from getting penalized.

Tom

ergophobe

8:34 pm on Aug 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



PS. You probably want to use absolute paths for your includes, otherwise it's going to get very messy.

include($_SERVER['DOCUMENT_ROOT'] . 'index.php');

Something like that.

HitsChatter

8:56 pm on Aug 13, 2004 (gmt 0)

10+ Year Member



Thanks for the tip. I usually do that, but a little different, so I didn't include it in the post. I have a config file that has two special variables called $root_dir and $root_url, and I use those for all my links and includes. Its saved me a TON of work on multiple sites when I've had to more things.