Mod rewrite question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kelicula
    Recognized Expert New Member
    • Jul 2007
    • 176

    Mod rewrite question

    I am trying to make the url change, and STAY that way.

    I would like to change url's of this type:

    [code]http://www.domain.com/someword/somenumber[/codel]

    into...

    Code:
    http://www.domain.com/cgi-bin/someword.cgi?id=somenumber
    I have that working, but what if I want the url in the address bar to change to:
    Code:
    http://www.domain.com/someword/somenumber
    AND STAY THAT WAY, while actually routing me to:
    Code:
    http://www.domain.com/cgi-bin/someword.cgi?id=somenumber
    Is this possible?
    Is mod_rewrite what I need?
    Or something else.

    I have seen many sites that use Perl, that DO NOT have the cgi-bin/script.cgi format on their pages.

    How do they do it?
    Last edited by Kelicula; Apr 11 '09, 01:39 PM. Reason: spelling, code tags
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Yes it is possible using rewriting.

    Check out some of these results.

    Comment

    • Kelicula
      Recognized Expert New Member
      • Jul 2007
      • 176

      #3
      Alright man, thanks!!

      I just had to remove the "R". For some reason I had the R=301 modifier.
      So it would re route you to correct script, but it would change the url in browser too. Without the R, it leaves the url entered untouched.

      Works great now!!

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by Kelicula
        Alright man, thanks!!

        I just had to remove the "R". For some reason I had the R=301 modifier.
        So it would re route you to correct script, but it would change the url in browser too. Without the R, it leaves the url entered untouched.

        Works great now!!
        Yep, the R forces a Redirect.

        Glad you got it working,

        - mark.

        Comment

        Working...