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 Coder
    Join Date
    Dec 2004
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    htaccess 301 help

    Hi,

    I have moved a folder on a site and I am wanting to do a 301 redirect on the old folder.

    So I have created my .htaccess file and included this:
    Code:
    Redirect 301 /sites/ http://www.mysite.com/links/
    This works and redirects however if the user visits sites/cat/animals/ it will redirect to links/cat/animals/

    So I am basically needing a way for it to drop anything after sites/. Is this possible?
    --
    Thanks,
    Eric
    Classifieds Software

  • #2
    Senior Coder
    Join Date
    Jul 2005
    Location
    UK
    Posts
    1,051
    Thanks
    6
    Thanked 13 Times in 13 Posts
    Yes it's certainly possible using regular expressions. Though, this isn't a PHP question, it probably belongs in "other server side languages/issues" or "general web building".

    But in the meantime you can look up mod_rewrite regular expressions and take a stab yourself.


  •  

    Posting Permissions

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