Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    .htaccess Rewrite problem with format

    I switched from one blogging platform to another, but the post IDs are the same between the two. so where:

    Code:
    RewriteRule ^article([1-9][0-9]*).* modules.php?name=News&file=article&sid=$1 [L]
    made URLs like /article123.html point to modules.php?name=News&file=article&sid=123

    With the new blogging platform, I want to direct the article123.html requests that exist in search engines to the new platform system, which would be ?p=123

    so why won't this work?
    Code:
    RewriteRule ^article([0-9]*).*$ ?p=$1 [L]

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    That works for me. Try going directly to the URL with a valid ID and see if the page loads, and/or dumping the variable to see if you get the value passed to the script. Or are you saying the request is never matched to begin with? Your regex is slightly different than the old one... it required there to be at least one number.


  •  

    Posting Permissions

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