Alternate Method Creating SEO Friendly Dynamic Sites

Discussion in 'Search Engine Optimization' started by Submerged, Aug 24, 2006.

  1. #1
    Hi, I'm kinda new here :) I was reading posts about how dynamic sites (mydomain.com/page.php?id=132&page=3&action=reply) can confuse the SEO engine and result in a bad crawl, and had a thought. Many users recommended using the apache mod_rewrite function. It sounds nice, but I don't think I can access the .htaccess file on my shared server (can i?). So I came up with this to make static pages as painless as possible.

    First, take a normal dynamic page, such as "page.php". Let's say the normal variables are category, article, and page. So the normal dynamic URL would be something like "page.php?category=13&article=45%page=2".

    Now take that page (page.php), and take out all the code requesting variables through the GET (or REQUEST) methods.

    Okay, now for the actual page. If "page.php?category=13&article=45%page=2" brings up the second page in an article about SEO, then we can do something identical by doing the following:

    Create "seo-article.php" wherever you want - perhaps in an article directory. The code inside seo-article.php should now look something like this:

    <?
    $category = 13;
    $article=45;
    $page = $_GET['page'];
    
    if ($page == 0){$page = 1;}
    include '/path/to/page.php';
    ?>
    PHP:
    Now this will show the equivelent of what "page.php?category=13&article=45%page=2" would have shown, but does it in a static page. However, it still maintains flexibility in the fact that you can edit "page.php" in the same method as a normal header/footer file. Note that you could jump to a specific page by linking to "seo-article.php?page=2", but the normal links (that google would search) would not contain any variables in the URL, and this would not confuse the engine.

    You do not even have to create these pages manually - for instance, assuming you don't have two articles with exactly the same name, you could have a script that creates a file called "$article_name.php" that automatically writes in the code above, with the article's category and number automatically going into it. Then, if your script is good, it will automatically add that new article into the directory or however you have it laid out.

    So, basically, it is a round about way of automatically creating a dynamically driven group of static pages. Mod_Rewrite is probably preferable if you can do it, but if circumstances do not allow for it then this way should be just as effective with a bit more setup.

    Any thoughts, comments?
    -Alex

    PS. For a very basic example:

    // page1.php
    <?
    $variable = "Hello World!";
    include 'page2.php';
    ?>
    PHP:
    // page2.php
    <?
    echo "$variable"; // prints "Hello World!" when page1.php is loaded.
    ?>
    PHP:

     
    Submerged, Aug 24, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This would work but I would be amazed if you couldn't access or create a htaccess file on your server.
     
    mad4, Aug 25, 2006 IP
  3. marketraise

    marketraise Guest

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hi:

    can you guys suggest that using htaccess can we fix the url on the address bar?

    Regards,
    marketraise
     
    marketraise, Aug 25, 2006 IP
  4. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #4
    What do you mean?
     
    mad4, Aug 25, 2006 IP
  5. Submerged

    Submerged Active Member

    Messages:
    132
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #5
    Wel... I have hosting at godaddy.com, and it doesn't seem to be located anyplace I can get with my FTP program. The online control panel doesn't seem to offer any leads either. How could I get to my htaccess file?
     
    Submerged, Aug 25, 2006 IP
  6. AStaupe

    AStaupe Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    just make a text file in notepad save it as type any file with the name .htaccess upload this file to the root directory with your FTP program and chances are you are good to go.
     
    AStaupe, Aug 25, 2006 IP
  7. Submerged

    Submerged Active Member

    Messages:
    132
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #7
    Hmmmm... well, I used the tutorial here:

    fantomaster.com/faarticles/modrewrite01.txt
    fantomaster.com/faarticles/modrewrite03.txt

    Uploaded the file at the root (which was "/", at the same level as the index page and everything)... It contains the following:

    RewriteEngine on
    Options +FollowSymlinks
    RewriteBase /
    RewriteRule ^(.*)lessons/(.*)$  $1article.php?lesson=$2
    
    HTML:
    So if I did that right, the URL google-central.com/lessons/5 should bring up google-central.com/article.php?lesson=5. However, it just comes with a missing page 404 error. article.php is ont he server, so is it something with the code or with the server? Thanks!

    -Alex

    PS. Sorry about having to manually cut/paste the links - It won't let me post URL's yet because I am less than 10 days old here :)
     
    Submerged, Aug 26, 2006 IP
  8. Sem-Advance

    Sem-Advance Notable Member

    Messages:
    6,179
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    230
    #8
    Actually many webhosting companies do not allow access to the .htaccess file due to the fact that a novice can destroy their own site and crash the server by using the file in the wrong manner.

    Great work around!!!!

    Need a job????
     
    Sem-Advance, Aug 26, 2006 IP
  9. Sem-Advance

    Sem-Advance Notable Member

    Messages:
    6,179
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    230
    #9

    Errr fantomaster?? dude thats full tilt black hat seo and not somewhere to tread lightly....
     
    Sem-Advance, Aug 26, 2006 IP
  10. Submerged

    Submerged Active Member

    Messages:
    132
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #10
    I just googled for a mod_rewrite tutorial, one of the top results was a forum (doriat.com) that linked to those text files (just the mod rewrite text files). Never seen the rest of the site. Thanks for the warning though :)

    Oh, and if you are serious about the job thing, I'm always ready to hear a proposal. I don't know if that was just a side comment or an actual question though :D
     
    Submerged, Aug 26, 2006 IP
  11. Sem-Advance

    Sem-Advance Notable Member

    Messages:
    6,179
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    230
    #11
    Well fantomaster probably knows more about white hat seo than most who claim to be such...so you can always learn but the program itself it an industrial strength cloaker that can get sites banned if discovered.

    It was an actual question ....I sent you a Private Message about the project work I could use help with at times.
     
    Sem-Advance, Aug 26, 2006 IP
  12. Submerged

    Submerged Active Member

    Messages:
    132
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #12
    Yeah, I got your IM... sounds cool :)

    Anyways, unless I did something wrong in the .htaccess code above (which is a definite possibility :D), I don't seem to be able to use mod_rewrite, so I might well be implementing the system I wrote up in my own website. If anyone wants some more explination I'l be happy to provide any help I can.

    -Alex
     
    Submerged, Aug 26, 2006 IP
  13. Sem-Advance

    Sem-Advance Notable Member

    Messages:
    6,179
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    230
    #13
    Thats cool and good to meet you... lots of potential you have...

    As for mod rewrite and godaddy...you are not allowed full scripting access...one thing any webmaster should ask a web host before signing up for an account...

    Peace and move to a better host :cool:
     
    Sem-Advance, Aug 26, 2006 IP