Forum Moderators: phranque

Message Too Old, No Replies

Rewrite rule redirect directory to directory/

         

adrianTNT

2:20 am on Aug 3, 2007 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hello.
I have this rule:

RewriteRule ^(.*)/ index.php?word=$1

Meaning that site/index.php?word=Adrian is also shown at site/adrian/
But how do I make it work without the slash at end too? site/adrian

I thing this should be simple but this is my first attempt with URL rewrite.
Thank you.

jdMorgan

2:26 am on Aug 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try:

RewriteRule ^([^/]+)/?$ index.php?word=$1 [L]

The pattern reads, "Match exactly, one or more characters which are NOT a slash, followed by an optional slash."

Jim