SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2001
    Location
    New York
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    301 redirect not redirecting individual pages properly

    So here is my 301 redirect in .htaccess. Instead of going to the destination URL, it's going to the destination domain name using the same URL, as if there is some setup on the domain (which is totally clean) to redirect an exact match of the first URL to the second:

    Redirect 301 /viewtopic.php?f=6&t=3 http://www.mysite.com/threads/got-stuff-for-you.3/
    Redirect 301 /viewtopic.php?f=11&t=5 http://www.mysite.com/threads/my-lovely-pictures.5/

    So instead of oldsite.com/viewtopic.php?f=11&t=5 going to mysite.com/my-lovely-pictures.5/ it is going to mysite.com/viewtopic.php?f=11&t=5 instead. I don't get it. That's not what usually happens on my other sites on the same server. Perhaps there is something funky using query strings?
    My law forum and legal information website -- I also buy websites you may wish to sell

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,650
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    slinky,

    I don't believe that mod_alias can examine the {QUERY_STRING} variable; you'll need mod_rewrite to do that.

    THEN, you're redirecting away from a link which will present a page to one which will not so you'll have to watch your logic in mod_rewrite. I have an example of just such a thing in my signature's tutorial article but read it carefully so you're not "loopy."

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


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
  •