Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 339
  • Last Modified:

Help with SEO Friendly Site Creation

Hello experts,
I am creating a directory. I have header, menu, footer, content
I am thinking of making them in HTML - for SEO friendly - My main goal is SEO friendly site.
all the contents on the pages are static - nothing dynamic.

I would like to do this in PHP - so, I can put the header, footer, menu in include files in a .php file - so, all the header, footer, menu kept separately and I only make change one place.

I do not know why but I am thinking that  but .php extensions won't be SEO friendly... but my url won't be www.site.com/id=?... It would be www.site.com/program/myprog.php

If I decided to do this html - then, I have to use frames to header, menu, footer - and this is NOT good for seos.

So, my question is:

1) If I create a php pages - are these SEO friendly?
Because, I think that if it is all in html page - menu, header, footer - seo knows all the items in that page - but if it is php file - then will the seo know what is in my page? I am kind of lost with this idea. again, all the content will be static.
2) If I do this in html - how do I put the header, menu, footer separely...
0
listings_
Asked:
listings_
  • 6
  • 5
  • 3
  • +1
2 Solutions
 
cdaugustinCommented:
Hi,

I believe this page has the answers for your question

http://roshanbh.com.np/2008/02/hide-php-url-rewriting-htaccess.html
0
 
GodDoesntExistCommented:
1. Yes, PHP include files WILL be SEO-friendly. They are outputting pure HTML to the webbrowser/visitor/search engine robots!

2. You won´t need it ;)
0
 
cdaugustinCommented:
if you find something that you dont understand leave a comment and il reply :)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
GodDoesntExistCommented:
And if your site will be all static, you wont need those php ?id= URL's.
0
 
cdaugustinCommented:
I was referring to the first part of the article :D but still GodDoesntExist is mostly right too, i guess its your call if to rewrite .php to .html (nobody knows FOR SURE what the search engines do in the back anyways)
0
 
GodDoesntExistCommented:
And if you need php url's cdaugustin's link above will help you with that ;)
0
 
listings_Author Commented:
GodDoesntExist,

If I have a good site navigation, with all the pages urls - then the seos will spiders them.. right? I am not quite sure about re-writing urls - since I think I can achieve seo friendly site thru .php...

right?
So, if I have a index.php
and I have a top - header.php, left - menu.php, right - the content for the index.php and bottom - footer.php

I can simply do include for all these?

Can you show me an example on how to do this?

And, will SEO know what is in the menu.php or footer.php if they are "include".... I am kind of lost in that sense... I usually think that .html page - is visible to seo right away - but .php - include file - won't be visible...
0
 
listings_Author Commented:
Because, if I am going to put all the navigation in menu.php and if the SEO does not seen it, then, I am loosing it.. right?

0
 
listings_Author Commented:
Thanks cdaugustin for your re-writing suggestion.. but I think I have a wrong opinion about .php extensions and seo.. if you guys answer last 2 of my points...that would be great...
0
 
kallestiCommented:
1) If I create a php pages - are these SEO friendly?
Because, I think that if it is all in html page - menu, header, footer - seo knows all the items in that page - but if it is php file - then will the seo know what is in my page? I am kind of lost with this idea. again, all the content will be static.

Yes. SE's read PHP pages and treat them just like HTML. If you view the page in the browser and view the source, you will see what the SE sees.

2) If I do this in html - how do I put the header, menu, footer separely...
I have often done a switch statement for the title tag because I want the title to be different for each page in order to provide the SE with the most accurate data.
0
 
cdaugustinCommented:
hi,

I will try to answer to your following two posts

-------------------
If I have a good site navigation, with all the pages urls - then the seos will spiders them.. right? I am not quite sure about re-writing urls - since I think I can achieve seo friendly site thru .php...

right?
So, if I have a index.php
and I have a top - header.php, left - menu.php, right - the content for the index.php and bottom - footer.php

I can simply do include for all these?

Can you show me an example on how to do this?

And, will SEO know what is in the menu.php or footer.php if they are "include".... I am kind of lost in that sense... I usually think that .html page - is visible to seo right away - but .php - include file - won't be visible...

&&

Because, if I am going to put all the navigation in menu.php and if the SEO does not seen it, then, I am loosing it.. right?

-------------------

When you are creating a page say index.php in which you use
include_once("top.php"); include_once("menu.php"); include_once("content.php"); etc

the search engine will only see index.php all the pages that are linked (either through your site or by external site) are likely to get indexed in the search engines. The inner parts of the page (the ones you are including like top, menu, content etc) are not meant to be seen by the search engine in the first place. The search engine needs access to the full resulting page which it gets through the link (on your site or other sites). So yoour not losing anything if the search engine doesnt see top.php (as a separate file) as its not suposed to see it.

I hope this sheds some light on your problem
0
 
listings_Author Commented:
Thanks kallesti.

Okay,  I am getting closer to understand...

Let's say, I have:
header.php and index.php. Code is below. So, when the search engine found my page (index.php) and place it's database, will the database contain what is in the my header.php file? like those list of menu items? You said it would contain - same as the source file of index.php - then my header.php would be visible.. right?

The reason that I am asking that - because - if I have all the keywords (navigation) in the header.php and if it is not in the seo database, I am screwed.. right?
======================================================================
Contents Of header.php
<?php
      <a href="#">Marc Andre</a>
      <a href="#">Leduc</a>
      <a href="#">Carl-Andre</a>
?>
now, my index.php
<html>
<title>A Basic PHP Website Using Include</title>
<body>

<p style="text-align: center;padding: 10px;">
include("header.php"); ?>
</p>

<p style="text-align: center;border: 1px dotted blue;">
Welcome to our website! The links above are being used in includes- saving us time that can be best used for developing better features for this website.
</p>

</body>
</html>
======================================================================
0
 
cdaugustinCommented:
Hi,

to answer your last comment, yes your index.php will have all the contents from header.php  and its perfectly safe to include it that way.

on regards of the header.php file if you dont have any php code omit the  <?php  ?>.

To clarify within <?php ?> tags you need to place valid php code.

In your case the contents Of header.php should be:

      <a href="#">Marc Andre</a>
      <a href="#">Leduc</a>
      <a href="#">Carl-Andre</a>
0
 
kallestiCommented:
It can be stored in the database or an include file. I always used a database. For example;

set your variable to the text that you would like to be in the title tag. $mytitle = (database value)

then output it on every page. <title><?PHP $mytitle ?></title>

You can store the whole header, I just always found this cumbersome as my description and keywords usually stay the same.
0
 
listings_Author Commented:
Thanks both...cdaugustin & kallesti.
Just a question for kallesti. Would you please give an example of what you are saying.. what kind of table (fields) and how would you use it.. it is sound very interesting idea...please give me a example.
0
 
kallestiCommented:
Sure, happy to. If you are using MySQL, you would create a table for the titles for each page. Something like this:

mytitletable (table name)

mytitle_id (autonum)
mytitle_title (nvarchar)
mytitle_pagename (HTML page name 'index.php')

When you run the query, you pull the page name dynamically by the path, then use it in the query to obtain the value of the title for that page.

select * from mytitletable where mytitle_pagename = $pagename

returns mytitle_title

Then you simple output it into the meta-title tag. Like this; <title><?PHP $mytitle_title?></title>

Hope this helps, it has saved me from over-coding. :)
0
 
listings_Author Commented:
Thank you both for your answers.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 5
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now