Quick mod_rewrite question

Discussion in 'Apache' started by CA3LE, Sep 7, 2010.

  1. #1
    Quick mod_rewrite question, I need drop everything in the example below from the "." on...

    http://sitename.url/forum/topic/10325.4395-
    
    to 
    
    http://sitename.url/forum/topic/10325-
    Code (markup):
    I need the dash at the end by the way, it's a call to action for something else... long story.

    ... it's giving me a headache, can someone please show me the correct way. :confused:
     
    CA3LE, Sep 7, 2010 IP
  2. CA3LE

    CA3LE Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Okay, I got it... I had it correct but I needed to put it in the .htaccess within the directory... other rules in there apparently were causing it not to work.

    Here was my solution.

    RewriteRule ^topic/([^/]+)\.([^/]+)\-$ /ipb/topic/$1- [R=301,L]
    RewriteRule ^topic/([^/]+)\;([^/]+)-$ /ipb/topic/$1- [R=301,L]
    Code (markup):
     
    CA3LE, Sep 7, 2010 IP