SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Pandora Tipem's Avatar
    Join Date
    Feb 2006
    Posts
    450
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Directory change / 301 permanent redirect

    Hi,

    I'd like to transform this url:

    www.mysite.com/gamehelp/index/
    www.mysite.com/gamehelp/anotherpage/

    TO

    www.mysite.com/neopets-games/index/
    www.mysite.com/neopets-games/anotherpage/

    Basically I've had a directory change would like to put in place a permanent 301 redirect rule to change the gamehelp to neopets-games. How could I do this... the atoms (I think that's what they're called) I'm using for both the first and second part of my URL are ([-a-z0-9]+) if that's of any help to you. I just don't know what flags to put in place to force the redirect (e.g., change the URL in the user's browser) and give HTTP 301 headers to search engines so they pick up on it too.

    Thanks in advanced.
    Tipem no fancy sig, yup
    Need Neopets Help? Try Neopets
    fun adoptable eggs

  2. #2
    SitePoint Enthusiast jameso's Avatar
    Join Date
    May 2002
    Location
    Melbourne, Australia
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Put this in a .htaccess file in the root folder on your web site:

    Code:
    Redirect 301 /gamehelp/ http://www.mysite.com/neopets-games/
    You shouldn't need to use mod_rewrite.

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


    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

  4. #4
    Pandora Tipem's Avatar
    Join Date
    Feb 2006
    Posts
    450
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. Works like a charm.
    Tipem no fancy sig, yup
    Need Neopets Help? Try Neopets
    fun adoptable eggs


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
  •