Solved

How Google see my links

Posted on 2014-07-29
2
263 Views
Last Modified: 2014-07-29
Hi E's,
I got a solution to create friendly URL's in my project, but not sure how Google will save or show these links.
The fact that I save the name of the friendly URL's in a database does not allow me to use the normal rewrite mode, so,
I had to opt for a slightly different solution, as you can see in this issue: EE Question

Basically this is the mechanism at work:mechanism
This simple example work in this way.
In index.php I have a link, with a friendly URL. When I click, .htaccess redirects to router.php. router.php will send to the real URL, in this case was article.php, but can be any URL. At first had this URL www.mydomain.com/article-eight-seven-eigth and at the end I will have a page with the real URL, like www.mydomain.com/article.php?id=878

This is the code of all files:
index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>home</title>
</head>
<body>
<p><a href="article-eight-seven-eigth">article 878</a></p>
</body>
</html>

Open in new window

.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ router.php [L]

Open in new window

router.php
<?php
//I will check url and redirect page based and that url

header( "Location: article.php?id=878" ) ; 
?>

Open in new window

article.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>article</title>
</head>
<body>
<p>the number of article is: <? echo $_GET['id']; ?></p>
</body>
</html>

Open in new window

So, my question is, how google will index the page, www.mydomain.com/article-eight-seven-eigth or www.mydomain.com/article.php?id=878?

The best regards, JC
0
Comment
Question by:Pedro Chagas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40227471
Google will index
www.mydomain.com/article-eight-seven-eigth

It will never see
www.mydomain.com/article.php?id=878
as that is for internal use only

But don't use something like article-eight-seven-eigth for the url, use the actual article title using the function I gave you in the other question to create the url from the title.
0
 
LVL 3

Author Comment

by:Pedro Chagas
ID: 40227482
Hi @Gary,
Again, thank you very much.
Yes, I will use the name of articles like you recommend. article-eight-seven-eigth is just a example.

The best regards, JC
0

Featured Post

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don’t want your company's site to fail on the web, you’d do well to observe these best web design practices and make sure you implement them when applicable.
Some of the SEO trends we might expect in 2017.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question