Welcome to WebmasterWorld Guest from 54.226.47.198

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

RewriteRule fix

     
3:11 pm on Jan 3, 2011 (gmt 0)

Junior Member

10+ Year Member

joined:May 11, 2004
posts: 130
votes: 0


hello,

I have this rewrite rule from above, the links will open as: domain.com/question/question/title

RewriteRule question/(.*)/title/(.*) question.php?question=$1&title=$2
RewriteRule question/(.*)/title/(.*)/ question.php?question=$1&title=$2


How to make the links show like:

domain.com/question/title ?

Regards,
Dan
3:33 pm on Jan 3, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member wilderness is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 11, 2001
posts: 5459
votes: 3


Basic same question just two days ago [webmasterworld.com] and active thread.
11:21 pm on Jan 3, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


The (.*) patterns will be problematical. Change them to be something more restrictive.

Add the [L] flag to both rules,

See the other thread for other issues.
7:08 pm on Jan 5, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


If more-specific subpatterns are used, then only one rule is needed:

RewriteRule ^question/([^/]+)/title/([^/]+)/?$ question.php?question=$1&title=$2

Jim