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 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Redirect or rewrite with htaccess

    Ok I am remaking my website, but there are links to multiple pages on my current one. Theres about 10 or so of these. So I simply want to point these 10 old ones to their new location on my website. The Domain name is the same, just how they are stored in MySQL is different.

    lets say currently one of my pages is at

    http://www.mydomain.com/index.php?category=2&id=3

    my new location will be

    http://www.mydomain.com/index.php/archive/2/3

    Please note I havn't actually switched my new system over, so ?category2&id=3 still exist.

    so I have tried

    Redirect permanent http://www.mydomain.com/index.php?category=2&id=3 http://www.mydomain.com/index.php/category/2/3

    in my htaccess,

    and when I go to http://www.mydomain.com/index.php?category=2&id=3 it still works. Is this because I have to actually remove the page before it will redirect it?

    I know htaccess shouldn't be this hard, I basically want to test it out on my webhost make sure it is working and I understand it before I move over to my new system.

    BTW my host is 1and1, on a linux server.

    Thanks for you responses in advance

  • #2
    New Coder
    Join Date
    Feb 2006
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts
    nobody?

  • #3
    Regular Coder medigerati's Avatar
    Join Date
    Jul 2005
    Location
    San Antonio, Tx
    Posts
    163
    Thanks
    0
    Thanked 7 Times in 7 Posts
    I'm not sure about having to remove the old page, but I know if you put [R=301] at the end of your rewrite rule, it will update the URL in the browser. Otherwise it will keep the same url no matter what page it redirects to.

    Example:
    Redirect http://www.mydomain.com/index.php?category=2&id=3 http://www.mydomain.com/index.php/category/2/3 [R=301]
    If you need a little more help, I'm available as a Website designer in San Antonio
    ----------
    If I've helped, please check out my friend's nature photography and let me know if you like anything.


  •  

    Posting Permissions

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