homepage Welcome to WebmasterWorld Guest from 54.167.182.201
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
RewriteRule fix
aff_dan

10+ Year Member



 
Msg#: 4248571 posted 3:11 pm on Jan 3, 2011 (gmt 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

 

wilderness

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



 
Msg#: 4248571 posted 3:33 pm on Jan 3, 2011 (gmt 0)

Basic same question just two days ago [webmasterworld.com] and active thread.

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4248571 posted 11:21 pm on Jan 3, 2011 (gmt 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.

jdMorgan

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



 
Msg#: 4248571 posted 7:08 pm on Jan 5, 2011 (gmt 0)

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

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

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved