How to rewrite url using .htaccess

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neovantage
    New Member
    • Aug 2008
    • 245

    #1

    How to rewrite url using .htaccess

    hey all,

    can anybody tell me that how can i rewrite this URL

    Code:
    http://74.52.129.114/~happybox/index.php?option=com_content&task=view&id=1
    into this

    Code:
    http://74.52.129.114/~happybox/about-us
    kindly help me out to sort out this issue.
    i will be really very grateful
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    I think that’s rather mapping, than rewriting …

    Comment

    • neovantage
      New Member
      • Aug 2008
      • 245

      #3
      And now what you mean mapping..? If you are using this word in domain sense then just leave it cos i am not going to run it on any domain.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        I mean it in the following way: you have a key phrase "about-us" and this is assigned a value phrase "index.php?opti on=com_content& task=view&id=1" but there is no logical relation between the two, so you need a kind of associative array/hash table to do this "mapping" without writing everything into the .htaccess file itself.

        Comment

        • Markus
          Recognized Expert Expert
          • Jun 2007
          • 6092

          #5
          A RewriteMap is maybe the way to go here, or if you're only wanting to map a few URLs, maybe instead use a RewriteCond.

          Comment

          Working...