SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Feb 2005
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with url rewrite with wildcard

    After changing the url structure in a part of my site, I need help with some rewrites.

    http://www.westeros.org/GoT/Characters/Entry/Ser_*

    needs to become

    http://www.westeros.org/GoT/Characters/Entry/*

    (as in, removing the initial Ser_ from a set of entries, but leaving anything after that part -- is that doable?)

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,097
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Sure is

    Code:
    Options +FollowSymlinks -MultiViews
    
    RewriteEngine On
    RewriteRule ^GoT/Characters/Entry/Ser_(.*)$ GoT/Characters/Entry/$1 [L,R=301]
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    SitePoint Evangelist
    Join Date
    Feb 2005
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, that doesn't seem to work. Clicking one of the outdated links doesn't lead to any rewriting at all.

  4. #4
    SitePoint Evangelist
    Join Date
    Feb 2005
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, fixed. I had to get less specific because of an earlier rewrite that it conflicted with. Thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •