#1
  1. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,689
    Rep Power
    171

    Mod re-write rule


    Hello Devshed;

    How can I use mode rewrite so this

    www.mysite.com/gallery/dishes

    shows the content of

    www.mysite.com/gallery.php?category=dishes

    I thought this does it but no
    Code:
    Options +FollowSymLinks
     RewriteEngine On
    RewriteRule ^gallery/([a-zA-Z0-9]+)/$ gallery.php?category=$1
    Thank you
    Last edited by zxcvbnm; September 19th, 2012 at 08:24 AM.
  2. #2
  3. Jealous Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,302
    Rep Power
    9400
    Even though you're using PHP, the question itself is about an Apache thing so I've moved it here.

    Except that the Rule requires a trailing slash, I think that should work.
  4. #3
  5. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,689
    Rep Power
    171
    Originally Posted by requinix
    Even though you're using PHP, the question itself is about an Apache thing so I've moved it here.

    Except that the Rule requires a trailing slash, I think that should work.
    O hey thanks for moving
    @requinix: I get a feeling that you know most of the answers and you put an effort to help which is highly appreciated but most of the times your answers are vague for me. I am sure it is not you, it's lack of my understanding of terminologies as well as coding. Imho when I spend the time to help someone in any forum I make sure I explain it as clear as possible in complete moron language.

    I couldn't agree more with the concept of "teaching how to fish instead of giving the fish away", but it is not the case here.
    Sometimes researching for terms (trailing slash for example) lead to more new things and instead of being constructive, it becomes distinctive until it explodes. I even forget what I have been looking for

    But one more time, you are a great helper and this is only my opinion; sometimes. I brought it up so I can use your tips better next time

    Thank you
  6. #4
  7. Jealous Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,302
    Rep Power
    9400
    Yeah, sometimes I'm vague. I tend to want whoever to solve it rather than me just give an outright answer but point taken: perhaps I should be a little more helpful.

    The trailing slash I was talking about was
    Code:
    RewriteRule ^gallery/([a-zA-Z0-9]+)/$ gallery.php?category=$1
                                       ^
    while the URL you posted doesn't have one.

IMN logo majestic logo threadwatch logo seochat tools logo