Sunday, October 11, 2009

URL Redirect .php to .html using with .htaccess rewriting

What is the benefits of rewriting URL?


When a search engine visits the dynamic url like product.php?id=5 it does not give much importance to that URL as search engine sees “?” sign treat it as a url which keeps on changing. so we’re converting the dynamic URL like the product.php?id=5 to static url format like product-5.html. We’ll rewrite the url in such a way that in browser’s address bar it will display as a product-5.html but it actually calls the file product.php?id=5. So that why these kind of URL also named as SEO friendly URL.


What is required for URL rewriting ??


To rewrite the URL you must have the mod_rewrite module must be loaded in apache server. And furthermore, FollowSymLinks options also need to be enabled otherwise you may encounter 500 Internal Sever Error. If you don’t know much about mod_rewrite module then please check this post to know how to check and enable mod_rewrite module in apache?

Examples of url rewriting for seo friendly URL


For rewriting the URL, you should create a .htaccess file in the root folder of your web directory. And have to put the following codes as your requirement.

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.htm$ $1.php [nc]
The following example will rewrite the test.php to test.html i.e when a URL like http://localhost/test.htm is called in address bar it calls the file test.php. As you can see the regular expression in first part of the RewriteRule command and $1 represents the first regular expression of the part of the RewriteRule and [nc] means not case sensitive.
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^product-([0-9]+)\.html$ products.php?id=$1
The following example will rewrite the product.php?id=5 to porduct-5.html i.e when a URL like http://localhost/product-5.html calls product.php?id=5 automatically.

SEO and Webdesign Support

Thursday, October 8, 2009

Google practices dividing to conquer


SAN FRANCISCO--Google's 8 billion-plus Web document index may not multiply, but its search engine will learn to better divide the data.

That was part of the message from Peter Norvig, Google's director of search quality, who on Tuesday gave a keynote speech here at the Semantic Technology Conference. Norvig, a former NASA employee and an author of books on artificial intelligence, highlighted several research projects the company is developing to help classify data and improve the relevance of search results.

Those projects focus on adding new clustering capabilities for search results, providing suggestions for related searches, personalizing listings, and returning factual answers to specific questions, Norvig said.
"We want to have a broader bandwidth for that kind of communication," Norvig said. "It's a question of what's the right language."

Despite heavy competition in recent years to own the largest document index, Norvig also said he couldn't foresee Google's database adding many more Web documents without cataloging bogus or useless pages. Still, the company has numerous programs to add otherwise inaccessible data, like that from books and TV shows, to its Web search engine.
Norvig highlighted a research paper written by a Google employee last year regarding a classification engine the company is testing. The technology can parse a proper noun or compound nouns into several categories in order to deliver clustered results, for example. For a query on "ATM," or asynchronous transfer mode, the engine would be able to use the terms "such as" on Web pages indexed with the term to discover that it can be linked to the expression "high-speed networks." As a result, a search for high-speed networks might pull up a cluster on ATM.

Norvig said the same technology could be used to mine factual answers from the Web for queries like "President Lincoln's birth date." The technique could offer an edge over Microsoft's recent addition of encyclopedic answers to its database, thanks to its Encarta software, Norvig said. That's because MSN's engine could miss the chance to deliver the desired factual answer if the searcher's query is inexact. In contrast, Google draws on the semantic Web and various language sets from pages to find a match.
 

Norvig also demonstrated Keyhole, Google's satellite mapping service. He said that over time, the company will greater integrate its maps and local information on businesses and places. "It's important to deliver information about the real world as people carry devices around," he said.

Share This

Bookmark and Share

Search This Blog