Use Descriptive URLs to Bolster Your Search Engine Rankings!
Dynamically generated pages, such as those made by PHP scripts, usually have URLs that aren't very readable, like "mysite.com/script.php'id=3951&page=2". The URL doesn't say anything at all as to what the page is, other than showing that it's generated by a script. If you want to make your dynamic pages more search engine friendly, rewrite your scripts to use descriptive URLs!
Phil runs a web development resource site. Find yourself asking, Where do I buy web hosting? Read all about it on Phil's site!
A URL like "mysite.com/blogpost/3951-People-Know-What-This-Is.html" would be a lot better, wouldn't it? Right off the bat, you know what the page is about. If you're scrolling through your recent pages, you can find exactly what you're looking for a lot easier. More importantly though, search engines love URLs like these, so you get a nice rankings boost!
As a PHP programmer, I'm going to detail this technique with PHP, but the same principle applies to whatever serverside scripting language you use.
To start, have the script execute as a file without the extension, instead of with the .php extension (or or .jsp, or whatever extension your language uses). On Apache servers, you can use a ForceType statement in the .htaccess file to make the script execute as application/x-httpd-php. This tells Apache to run the file as a script instead of just spitting out your code.
Right now, your script should work properly as "mysite.com/script'id=3951&page=2". It's no longer readily apparent which language your site uses, but you can still tell that it's a dynamic page. Let's fix that next, by using PHP's explode function to break up the argument list. Using this, the arguments to your script will look like folders on your server instead of parameters to a script:
$args = explode("/",$_SERVER['PHP_SELF']);
Now, if you were to access "mysite.com/script/3951/2", $args would become an array with "3951" and "2". You can replace the slash with a hyphen to separate arguments without making them look like directory entries, or use a second explode statement to break down some of the arguments in a different way.
Finally, write some code that converts the title of the content (be it the blog post name, forum topic, etc.) into an argument, substituting dashes for spaces. Some people use underscores instead of dashes, but the search engines don't see underscored words as separate terms, so you end up with the search engine thinking "This_Is_My_Post" is one big word.
Add a pinch of code at the top of the script to make ensure that the URL matches the one you want it to be (so it redirects thread/4614-wrong-name-1 to thread/4614-This-is-my-posts-name-1), then add .html to the end of it (so it looks like an innocent html file) and you're good to go!
To prevent stuffing the url with words that don't really matter, use the string replace functions to remove words such as "I", "The", and "And" from the URL.
Most search engines won't completely index your website if it's all stuffed into argument lists, so by having URLs that look like normal filenames you both ensure that all of your pages are indexed and increase your search engine optimization. Making your URLs readable by humans is juts an added bonus. Make sure to update the links within your site to reflect your new URLs, so your page doesn't turn into a smattering of redirects.
Related Articles:
Professional Recruitment in Open Source Technologies
Open source development is gaining momentum day by day. The community of online open source developers is engaged in continuous development of new technologies as well as making existing technologies more robust. The development of new tools and development platforms are making programmers work easier. There are various segments of open source development like in the field of operating system, scripting languages, popular CMS, multimedia tools, web browsers and much much more.
KnowledgeTree and CorraTech Partner to Provide Global Open Source Document Management Services
KnowledgeTree and CorraTech partner to promote popular open source document management software in North American and Western European markets.
Stormy Peters of OpenLogic to Discuss Legal Concerns of Open Source at LinuxWorld 2007
Stormy Peters, Director of Community and Partner Programs at OpenLogic, will be speaking at LinuxWorld 2007 on various open source legal concerns, and the tools and methodologies Global 2000 companies have adopted to address these concerns. A survey of CIOs shows that more than 80% of enterprises are already using or intend to use open source software. As adoption of the technology grows, legal concerns around its usage demand more time from management and attorneys. In her talk, Stormy addresses their concerns and the ways they deal with them.
Sun Microsystems and Zmanda to Deliver Comprehensive Database Backup & Recovery Solutions for MySQL Enterprise Customers: Enterprise-Wide MySQL Dat
Sun Microsystems, Inc. (NASDAQ:JAVA) and Zmanda, the open source leader in backup and recovery software, today announced they are partnering to deliver a comprehensive, global data backup and recovery solution for MySQL Enterprise subscribers. A 30-day trial of Zmanda Recovery Manager Enterprise Edition -- the first open-source backup and recovery solution designed specifically for MySQL(TM) databases -- is available now at . Starting April 1, MySQL Enterprise customers will be able to purchase ZRM for MySQL directly from Sun worldwide. Zmanda and Sun have also agreed to joint-selling and co-marketing activities in support of MySQL, the world's most popular open source database software. ...
CorraTech Aligns with SpikeSource to Deliver Integrated Business-Ready Open Source Applications
CorraTech and SpikeSource form an alliance to deliver a fully supported, integrated suite of open source business management applications. The initial release of OpenSuite™ will include CRM and Enterprise Collaboration solutions.
Open Source Initiatives Need More Concerted Efforts
Major corporate houses choose open source partly due to the economic gains and mainly due to the control the open source system gives to their hands.
Open Source Bridge Conference Announces Speakers for Inaugural Gathering of Open Source Citizens | Yahoo! Developer Network, Mozilla, WebTrends, and G
Open Source Bridge, a new conference designed to increase collaboration in the open source development community across a broad range of disciplines, announced today its confirmed list of speakers, featuring topics that range from the Linux kernel to Configuration Management to MySQL to the Android mobile platform and everything in between.
Sun Celebrates Third-Party MySQL Storage Engines: Oracle, Kickfire, PrimeBase Technologies and Infobright Join Sun
in Supporting the World's
Sun Microsystems, Inc. (NASDAQ:JAVA) today announced new and enhanced third-party support for the MySQL(TM) database's unique pluggable storage engine architecture. The MySQL Certified Storage Engine Program () enables commercial and community database engine developers to certify that their software has been tested and is compatible with Sun's MySQL Database Server - helping to assure MySQL users that these certified engines have reached high-level standards of usability, performance and integration.
Saugatuck Study: Open Source Changes Software, While Software Changes Open Source
Research and analysis indicate that software prevalence has changed the nature of "open source"
KnowledgeTree Document Management Software Announces Adoption of GPL v3 Free and Open Source Software (FOSS) License
Adoption of OSI-approved GPL v3 License Strengthens Open Source Community Participation In Leading Open Source Document Management Project
Open Source Software and osCommerce
Open Source Software and its Relation to osCommerce
Delivered Innovation Sponsors Saper Law Offices ‘Open Source Symposium’ In Chicago
Leading SaaS application developer () Delivered Innovation to sponsor full day conference bringing members of the open source community together for detailed discussions involving the legal and intellectual property implications of producing or using open source software.
Is Open Source the Right Solution for Your Higher Ed Campus?
Edu1world has launched the first web 2.0 professional community devoted to sharing information on open source software solutions for higher education. The vendor-neutral edu1world Open Source Community connects successful open source users on campuses worldwide with colleagues looking for guidance on a wide variety of products and providers. Thought leaders in the open source software industry are encouraged to join and share their knowledge. Participation is free for employees of higher ed institutions; vendors and consultants may also join for a nominal monthly fee.
GroundWork Open Source Announces New CentOS Linux Appliance for GroundWork Monitor Enterprise 6.1
OpenLogic to Provide CentOS Support for GroundWork Customers
Open Source Support Center Launches U.S. Headquarters
Europe's largest independent open source service and support company, credativ, is expanding its Open Source Support Center to the U.S. market to satisfy the rapidly growing need for expert assistance with open source technologies.