Tutorial :Search Engine Friendly POST in php and MySql [closed]



Question:

i have one blog where users come and post their views. i store all information in mysql Data Base, when i use following syntax to retrieve information Datasbe using PHP

viewpost.php?pid=12

but after Google many tips for SEO, i found that this syntax is not good, i need to change it to some other way which is readable to search engine.

exactly like stackoverflow.com does. like every question have its url like

   http://stackoverflow.com/questions/1696938/c-objects-by-ref  

i search all day but did't get any idea how can i do something like this in PHP & MYSQL

Hope i will get good help.

Thanks


Solution:1

If you're on IIS try Ionic's Isapi Rewrite Filter

http://www.codeplex.com/IIRF

it's a free url rewriter for IIS


Solution:2

You usually use Apache's mod_rewrite (other webservers have similar functions) to accomplish this. Read more about mod_rewrite here: http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

Using mod_rewrite /questions/1696938/c-objects-by-ref gets rewritten to (as an example) questions.php?id=1696938. The c-objects-by-ref part is probably there only to make the url more readable to humans, and look nicer to search engines.

In your case I would rewrite /post/$id/human-readable-name to /viewpost.php?pid=$id


Solution:3

you have to rewrite your urls

so that domain.com/12/title-of-post goes to domain.com/viewpost.php?pid=12

try this page for more in depth information


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »