How to do URL Re-writing in PHP with Simple htaccess Modify

URL re-writing means reformatting the webpage URL and turn your long dynamic URL into a shorter and static one.It gives  a better representation of your URLs.To accept GET arguments through a URL we need to modify the .htaccess file in root website folder.Which helps to convert your Page Urls into well organized form.e.g.

to

Generally this is nothing more than enabling the mod_rewrite module (you likely already have it enabled with your host), and then adding a .htaccess file into your web-directory. mod_rewrite is used for rewriting a URL at the server level, giving the user output for that final page.

There are two ways of Respresention of your URL ,they are :-

Type 1 – Single Page URL

Generated URL http://techniblogic.com-tag-seo.htm
Example URL http://techniblogic.com-tag-(Any Value).htm

Create a .htaccess file with the code below
The .htaccess file needs to be placed in techniblogic.com

Type 2 – Directory Type URL

Generated URL http://techniblogic.com/tag/seo/
Example URL http://techniblogic.com/tag/(Any Value)/

Create a .htaccess file with the code below
The .htaccess file needs to be placed in techniblogic.com

You can use SIMPLE .htaccess URL Rewriting Tool for Regenerate URL rewrite rules for your Apache .htaccess file. It takes a list of dynamic URLs and converts them into SEO friendly static URLs.

  1. Open URL Rewriting Tool Pagenimtools-htaccess URL Rewriting Tool
  2. Enter the Query URL in the Input Box
  3. It will Generate 2 Formats of URL Representations.Choose the method you like.
    nimtools-htaccess URL Rewriting Tool type 1
    Type 1 – Single Page URL
    nimtools-htaccess URL Rewriting Tool type 2
    Type 2 – Directory Type URL

    This tool help you to easily create code for your .htaccess file,you just have to copy and paste that created.

  4. Done

URL Rewriting FREE Tool

Hope this will help you and solve your problem 🙂

Leave a Reply