search engine friendly URL - Create Search Engine friendly URL in PHP and htaccess

Create Search Engine friendly URL in PHP and htaccess

Posted on

search engine friendly URL - Create Search Engine friendly URL in PHP and htaccessPicture you’ve a Web site which offers with information/updates on finance business. You could have admin panel the place you used to publish information/ picture gallery on every class. Every class/publish in your web site has one distinctive id which is generated once you create any new class or publish any information in that class.

Whenever you publish information underneath class ‘Funding’ which has class Id Three in database and gave publish title ‘Finest long run funding choices in India’ which has a publish id 207 in database. Your publish URL will comprise these Ids so that it’ll acknowledge the publish have to show to person.

This strategy of making URL has few points.

  • Not human readable/pleasant
  • Lacking vital searchable Key phrases
  • It’s not Search Engine pleasant

Serps and customers might have issues with difficult URLs. A transparent, easy and descriptive URL can be extra attraction-sicker to each Human and Search Engines.

Pleasant URL

Search engine pleasant or human-readable or clear URLs are URLs that make sense to each people and search engines like google and yahoo as a result of they clarify the topic of the Web page/Put up it’s pointing to.

Let’s see how we will create a Search Engine pleasant URL utilizing .htaccess and PHP. It is advisable first allow apache mod_rewrite module for this code to work.

Following PHP code will convert your parametric URL into Search Engine Pleasant URL.

Calling create_final_url perform will convert to www.mydmain.com/finance/funding/best-long-term-investment-options-in-india-A207.html

Be sure to add following htaccess rule in your .htaccess file.

Supply techzoo.org