Creating Search Engine Friendly URLs In PHP
Article Comments (5 total)
joycelorenza, 20 November 2008
Comments about Search Engine-Friendly URLs You'll recall that the thing that trips up Google, and maybe even other search engines, when using the PATH_INFO method is the period in the middle of the URL. So what if there was a way to use that method without the period? Guess what? There is! Its achieved using Apache'’s ForceType.The ForceType directive allows you to override any default MIME types you have set up. Usually it may be used to parse an HTML page as PHP or something similar, but in this case we will use it to parse a file with no extension as PHP.So instead of using article.php, as we did in method 1, rename that file to just "article". You will then be able to access it like this: http://www.domain.com/article/999/12/, utilizing Apache's look back feature and PATH_INFO variable as described in method 1. But now, Apache doesn’t know to that "article" needs to be parsed as php.
-----------------------------
joycelorenza
SEO
Peter, 10 November 2008
One of the major reasons for using a serverside language such as PHP is for the ability to generate dynamic content. Often this will lead to single scripts. Search engine friendly URLs also easily allow you to hide the type of server.
===========================
Peter
SEO
Maginot, 7 September 2008
Very good article!
I was using the 404 error page to handling actions to views based on the controller (MVC style) but without know if that was a good Idea.
One thing that Im still missing is that after the 404 page handle the request when it redirects with a header("location") the url changes to the normal way...
Very good site, very good articles, congratulations to you all.
best regards [ ]s
Moob, 21 August 2008
I have implemented the custom 404 method, but it seems to have a big disadvantage. Although I send a 200 OK header, clients still get a 404 header. Is there any solution for this?
Alex, 14 January 2008
Regarding the last method (custom 404). It's one of the only method you can use on most the free PHP hosts (they more or less never let you use mod_rewrite). But, it has a really big problem, posted data (data in the $_POST array), won't work (works for the $_GET).




