The above lends itself poorly to SEO. I'd suggest not using it unless you provided full fledged links instead of querystrings.
The above lends itself poorly to SEO. I'd suggest not using it unless you provided full fledged links instead of querystrings.
To err is human. To really foul things up ... you need a computer.
This really seems to be a historic problem. The newer algorithms on google etc are so heavily content biased that link format does not seem to have any bearing as far as I can see.
Otherwise things like forums would never get high rankings, and this is not the case.
I released the same site in two versions once to test this and the google rankings came out the same.
Is there any recent (last 3 months or so) which suggest query string links affect seo analysis?
In the long term keyword links provide better SEO. Take for example Amazons recent changes to URL formatting:
I have built numerous sites with similar formatting and they succeed particularly well in search rankings.Code:http://www.amazon.co.uk/books-used-books-textbooks/b/ref=topnav__b/026-7353250-3955617?%5Fencoding=UTF8&node=266239 http://www.amazon.co.uk/Happy-slapped-jellyfish-words-Pilkington/dp/1405328479/ref=pd_nr_c_th_2/026-7353250-3955617?pf_rd_m=A3P5ROKL5A1OLE&pf_rd_s=center-9&pf_rd_r=1XDK9ZHQPD76JNYNS4DT&pf_rd_t=101&pf_rd_p=114534891&pf_rd_i=89
To err is human. To really foul things up ... you need a computer.
Ok, well we will see how this goes, ive customised it to do just what i need it to do!
index.php
pagelist.phpPHP Code:
<?php include("top.php");?>
<?php include("pagelist.php");?>
<?php include("bottom.php");?>
It works fine, is that how you meant?PHP Code:
<?
if(isset($page))
{
switch ($page)
{
case "resturant":
include "resturant.php";
break;
case "home":
include "home.php";
break;
case "search":
include "search.php";
break;
//the default situation in a switch catches the situation where the file variable
//has been set to something stupid, like file=jhasdkjf
default:
print("<h1>Site error</h1>");
print("<h3>No Page Found</h3>");
print("<p class=\"content\">
The link you have chosen has not found a valid page use the link below to
return to the home page</p><p class=\"content\">
Please check the link if you typed it yourself, use the <a class=\"gen\" href=\"index.php?file=contact\">
contact</a> form to inform the webmaster of a site error.</p>");
}
}
// This catches the default situation where no 'file' variable has been set
else
{
include "home.php";
}
?>
(\__/)
(='.'=)
(")_(")
Yeah precisely, there are a multitude of ways you can do this but this is the method I use.
It's widely used for sites with a lot of content as it make the index/template page very easy to maintain.
If however, you only have 2-3 pages (which from looking at your site, you might) it could be overkill.
Good good, and there will me many more pages - but i need to make them first
(\__/)
(='.'=)
(")_(")
Your 'no page found' page should really return as 404 in the header.
To err is human. To really foul things up ... you need a computer.
ok, ive setup some if commands to sort that out but do you mean just 404 or something like 404 - page not found - does it matter?
(\__/)
(='.'=)
(")_(")
Personally I would not see any problem with using the method suggested for pages 'not found' so to speak.
The problem with this method is that index.php?file=kjadhfafgjk will never return a 404 because index.php will always be found, what it won't return is any content, since the file variable will not match any associated content.
Therefore, the cleanest way is to handle this in the script, by displaying the equivilent of a 404 error without having to exit out of the template page.
I would not see any advantage in forcing the script to redirect to a page which would then show a 404, it is surely better to include error handling, which allows the site look and feel to remain and allows clean options to return to the home page etc.
Interesting point though, are you aware of any advantage of showing a 404? I suppose in terms of say, web reporting, it gives a better representation of how many time a user typed an incorrect url, but surely that's about it.
Hi again,
ive realised that the search script ive been using is not really any good.
Ive done some searching and found this one: http://www.roscripts.com/PHP_search_engine-119.html
Ive adapted it to attempt to get it to work from me (ive created the articles table as used in the tutorial for testing purposes) however im getting an error i dont understand - is it fixable or is there a better search solution to use??
Last edited by nvening; 02-05-2011 at 01:52 PM.
(\__/)
(='.'=)
(")_(")
Would need more info on this to be honest, what is the error you describe?
if you wanted very simple searching (such as looking for a word within a phrase) you can use simply SQL 'like' statements.
It really depends on the purpose, what options you wish to provide, and how complete you want the solution to be.
Give me something work with
I had setup a simple search using like but ive realised that its not really much good as it relys on people searching for just one word, or the exact string. This script should get round all this (see the tutorial)
And sorry the error im getting is
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') GROUP BY id ORDER BY occurrences DESC' at line 1
thanks
(\__/)
(='.'=)
(")_(")
Echo your query to the page, put it in a SQL parser and find out where the problem is.
To err is human. To really foul things up ... you need a computer.
This is usually down to a variable not being populated in the sql query.
for example if you query is something like
then if your $name variable is empty, you would get this type of error.PHP Code:
$query = "select name,age,sex from person where name = '$name' and age='$age'";
As yamangman says, echo your query (sometime the error is obvious from this) and check the sql syntax.
Post the echoed query here and I'll take a look.
Well the query is somewhat more complicated that what im used to:
But a get the gist of it, however echoing it gives:PHP Code:
$sql = "SELECT DISTINCT COUNT(*) As occurrences, id, title, subtitle, content FROM articles WHERE (";
while(list($key,$val)=each($split_stemmed)){
if($val<>" " and strlen($val) > 0){
$sql .= "(title LIKE '%'.$val.'%' OR subtitle LIKE '%'.$val.'%' OR content LIKE '%'.$val.'%') OR";
}
}
$sql=substr($sql,0,(strLen($sql)-3));//this will eat the last OR
$sql .= ") GROUP BY id ORDER BY occurrences DESC";
SELECT DISTINCT COUNT(*) As occurrences, id, title, subtitle, content FROM articles WHER) GROUP BY id ORDER BY occurrences DESC
it seems to be cutting the WHERE off or something??
thanks
(\__/)
(='.'=)
(")_(")
There are currently 1 users browsing this thread. (0 members and 1 guests)