|
|
|
04-17-2008, 06:47 AM
|
Postid: 167059
|
|
Site Owner
Forum Notability:
1175 pts: A True Crowd-pleaser!
[ Post Feedback]
Join Date: Feb 2005
Location: Connecticut
Posts: 719
|
Re: Value of links in SEO
Good point.
Quote:
|
I hate to open this can of worms, but ...
|
Just to clarify, I'm talking about something like this (without a redirection code):
Quote:
|
RewriteRule ^Donations/?$ index.php?act=14 [L]
|
When I type or click on a link to "domain.com/Donations" the browser shows "http://domain.com/Donations" in the address bar, even though a different file was executed.
I assume that from the outside, there is no way to tell that there isn't a file at "http://domain.com/Donations/index.php"
Anybody know if this is true?
|
|
|
04-17-2008, 10:11 AM
|
Postid: 167060
|
|
Registered User
Join Date: Nov 2007
Posts: 50
|
Re: Value of links in SEO
Quote:
|
Anybody know if this is true?
|
Yes, this is performed before the page is crawled and there is no way for the spiders to know this was rewrittern.
A redirect returns a 301 or 302, etc, code to the crawler, so it would recognize that.
I use mod rewrite extensively and Google never has any issues with them.
Now, on the other hand - if one has links to both the "index.php?act14" page and the exact same "donations.php" page, Google would recognize this as duplicate content. I just read an article from Google that states they do not penalize for duplicate content, but will filter out similar results.
The way to combat the duplicate content is in two ways. First, make sure all links are to the re-written page, not the old ones. Two, use the robots.txt to exclude such filenames to ensure only the "user friendly" names are crawled.
|
|
|
04-19-2008, 11:46 AM
|
Postid: 167099
|
|
Site Owner
Forum Notability:
169 pts: Ambassador of Goodwill
[ Post Feedback]
Join Date: Mar 2006
Location: Czech Republic mostly
Posts: 514
|
Re: Value of links in SEO
Quote:
Originally Posted by Tom E.
Exactly.
How about something like this:
a lot of coding
<title><?= $page_title ?></title>
some more coding
|
Tom E., initially, your solution did not work  and because it looked complicated to me --  -- I said I was tired, didn't I -- I kept looking further. A bit fresher this weekend I retried every solution offered, also in another forum, and found out that actually yours does work.  The only thing that was missing was "echo" in the <title> statement.
When writing it as <title><?php echo $page_title ?></title> it seems to work   . I also changed the shorthand ? into ?php; my local server uses php5. Am now checking and completing it, but this seems to be the solution.  I'll get back when I am ready with testing.
The URL redirect, searched that one also, will do that also when I read a bit more about that.
Apart from what is mentioned here, I also found some other interesting detailed articles about SEF URLs:
http://www.webmasterworld.com/forum92/6079.htm
http://www.sitepoint.com/article/guide-url-rewriting/1
http://www.sitepoint.com/article/guide-url-rewriting
|
|
|
04-19-2008, 01:25 PM
|
Postid: 167100
|
|
Site Owner
Forum Notability:
1175 pts: A True Crowd-pleaser!
[ Post Feedback]
Join Date: Feb 2005
Location: Connecticut
Posts: 719
|
Re: Value of links in SEO
I'm glad it's working for you
Quote:
|
The only thing that was missing was "echo" in the <title> statement.
|
You must have missed the "=" (after "<?") when you typed it in.
My example uses a special form of the opening PHP tag:
PHP Code:
<?= $page_title ?>
is equivalent to
<?php echo $page_title ?>
It's a shorter and more readable way to echo a single variable or short string inside some HTML.
|
|
|
04-19-2008, 01:45 PM
|
Postid: 167101
|
|
Site Owner
Forum Notability:
1175 pts: A True Crowd-pleaser!
[ Post Feedback]
Join Date: Feb 2005
Location: Connecticut
Posts: 719
|
Re: Value of links in SEO
Quote:
|
I also changed the shorthand ? into ?php; my local server uses php5.
|
It works in PHP 5 if the 'short_open_tag' option is enabled (which is the default setting on my FQ sites).
Some people recommend against the short tags, in order to make your code more portable, but I prefer them. Plus it's not hard to do a global search-and-replace if you ever have to move code to a server that has short tags disabled.
|
|
|
04-19-2008, 04:02 PM
|
Postid: 167103
|
|
Site Owner
Forum Notability:
169 pts: Ambassador of Goodwill
[ Post Feedback]
Join Date: Mar 2006
Location: Czech Republic mostly
Posts: 514
|
Re: Value of links in SEO
Quote:
Originally Posted by Tom E.
I'm glad it's working for you
You must have missed the "=" (after "<?") when you typed it in.
My example uses a special form of the opening PHP tag:
PHP Code:
<?= $page_title ?>
is equivalent to
<?php echo $page_title ?>
|
Maybe this is an issue of Apache 2.2/PHP 5.2.5 with the new standards versus older versions? Maybe I could have save a lot of time if I tried it on FQ in stead of only home with the "out of the box" installment of the local server, which probably is rather restrictive and unforgiving.
When trying the first time, I just copied and pasted your code. When I retried it just now, it now gives the pages as should (I probably had some other errors earlier as well) but no proper page title. Going from <? to <?php gives the following error
Parse error: syntax error, unexpected '=' in C : \apache\htdocs\FORS-domain\www\index.php on line 42
When I use the echo in stead of =, all works perfect.
Anyway, I am happy, thanks for the suggestions, I am now writing the different titles and doing some further polishing and cross-browser testing.
|
|
|
04-19-2008, 04:32 PM
|
Postid: 167104
|
|
Site Owner
Forum Notability:
1175 pts: A True Crowd-pleaser!
[ Post Feedback]
Join Date: Feb 2005
Location: Connecticut
Posts: 719
|
Re: Value of links in SEO
You can check your local setup by creating a PHP file with this line:
PHP Code:
<?php phpinfo(); ?>
When you look at the results in your browser, search the page for "short_open_tag" (it's near the bottom of the "PHP Core" section).
If "short_open_tag" is off, you can turn it on in your local setup to match FQ.
If "short_open_tag" is on, then I don't know what the problem could be.
|
|
|
04-19-2008, 05:27 PM
|
Postid: 167106
|
|
Site Owner
Forum Notability:
169 pts: Ambassador of Goodwill
[ Post Feedback]
Join Date: Mar 2006
Location: Czech Republic mostly
Posts: 514
|
Re: Value of links in SEO
My apologies, I should have been clearer. It is off, and I left the settings on purpose at the default version, which is more restricting probably.
Argument is that if it works good at home, I should be save at FQ and when making sites for others who may have different hosts. Since I am relative new in php and not already used to writing things differently for earlier versions, I might as well stick to the "restricted" versions immediately, I don't know better.
|
|
|
04-19-2008, 06:21 PM
|
Postid: 167107
|
|
Site Owner
Forum Notability:
1175 pts: A True Crowd-pleaser!
[ Post Feedback]
Join Date: Feb 2005
Location: Connecticut
Posts: 719
|
Re: Value of links in SEO
Ah, I understand.
|
|
|
04-19-2008, 06:53 PM
|
Postid: 167108
|
|
Site Owner
Forum Notability:
169 pts: Ambassador of Goodwill
[ Post Feedback]
Join Date: Mar 2006
Location: Czech Republic mostly
Posts: 514
|
Re: Value of links in SEO
I managed to get a dynamic meta tag "description" (metadesc) working as well adding the coding pair:
line 26 $page_metadesc = $act_values[$act]["metadesc"];
and
line 42 <meta name="Description" content="<?php echo $page_metadesc;?>" />
One thing I do not understand. If in the original array the title is not set, or a completely non-existing page is called, the function returns a 404 page, conform the coding. When adding the metadesc coding but leaving the array empty for metadesc, it does return a 404 but also inserts a warning notice (level I set on the server):
Undefined index: metadesc in C : \apache\htdocs\FORS-domain\www\index.php on line 26 (the first line of the extra code).
Why the difference in reaction? I do not recognize in the coding that the 404 is linked to a specific part of the array so it should react the same or do I miss something?
Last edited by McDuff : 04-19-2008 at 06:55 PM.
Reason: get the @#$% smile out from the c :\ address
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 12:24 AM.
|
| |
|
|
|