i want to htaccess code with argument vlaue passing using php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saravanatmm
    New Member
    • Mar 2008
    • 5

    i want to htaccess code with argument vlaue passing using php

    I have used htaccess file for static page. for example
    I have used the url for about us page

    But how can i do the htaccess for argument.
    could u please give me explanation for htaccess and codes how can i do it.

    i want this format http://www.example.com/example instead of the following format http://www.example.com/example.php?pag eid=20

    Please help to me.
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Originally posted by saravanatmm
    I have used htaccess file for static page. for example
    I have used the url for about us page

    But how can i do the htaccess for argument.
    could u please give me explanation for htaccess and codes how can i do it.

    i want this format http://www.example.com/example instead of the following format http://www.example.com/example.php?pag eid=20

    Please help to me.
    first you need to have this at the root of your site in a htaccess file:

    [color=#000000]RewriteEngine on
    RewriteRule !\.(js|ico|gif| jpg|png|css)$ index.php

    replace index.php with your default page as necessary.

    That code forwards all non-resource URL to your home page.

    Then you need to PARSE the URL. I won't go into it here but
    there are lots of resources for you that can guide you through it.

    What you're wanting is called human-friendly URLS

    so this:

    [/color]http://www.example.com/example.php?pag eid=20

    can be replaces with this:

    http://www.example.com/pageid/20


    Zend Framework does this:

    http://framework.zend. com/manual/en/zend.controller .html#zend.cont roller.quicksta rt

    Comment

    Working...