Results 1 to 6 of 6

Thread: A special 301 redirect, when renaming a directory

  1. #1
    cowardino is offline Registered User
    Join Date
    May 2007
    Posts
    8

    Default A special 301 redirect, when renaming a directory

    Hi

    A couple of years back a friend set my indexu up, with the rewrite dir for tags called /-/ instead of /tag/
    Now I would like to use the dir name /tag/ instead of /-/, and I know how to rename with the rewrite feature.

    I would like to know if it is possible to make ONE global 301 redirect, with this result:

    Old url
    www.domain.com/-/Mode

    to New url:
    www.domain.com/tag/Mode

    But, I have many (thousands) "tag" directories under the main directory /-/
    and would like a 301 redirect that automatically redirects all
    subdirectories

    More examples:

    Old url
    www.domain.com/-/Online

    to New url:
    www.domain.com/tag/Online
    -----------
    Old url
    www.domain.com/-/Surfing

    to New url:
    www.domain.com/tag/Surfing
    -----------
    Old url
    www.domain.com/-/Hardware

    to New url:
    www.domain.com/tag/Hardware
    -----------

    etc etc

    Jones

  2. #2
    Bruceper is offline Active Member
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    The following should work

    RewriteRule ^-/(.*) http://www.yoururl.com/tags/(.*) [R=301,L]

    But I'm not an expert. You might want to ask at Mod_Rewrite Forums :: Index

  3. #3
    cowardino is offline Registered User
    Join Date
    May 2007
    Posts
    8

    Default

    Hi

    Thank you for your info.
    Unfortunately it did not work.

    Jones

  4. #4
    chunguens is offline Registered User
    Join Date
    Nov 2008
    Posts
    89

    Default Url rewrite


  5. #5
    Paps is offline Registered User
    Join Date
    Mar 2007
    Posts
    26

    Default

    RewriteRule ^-/(.*) tags/$1 [R=301,L]

    maybe this one works

  6. #6
    Bruceper is offline Active Member
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    yup, I b0rked up by not using $1

    Some days I hate .htaccess

Similar Threads

  1. 301 Redirect htaccess
    By Boxxer in forum v5.x
    Replies: 5
    Last Post: 10-05-2007, 11:17 AM
  2. 301 redirect
    By spin in forum v5.x
    Replies: 7
    Last Post: 07-23-2007, 01:52 PM
  3. [important]302 redirect
    By dody in forum v5.x
    Replies: 20
    Last Post: 05-12-2005, 07:30 PM
  4. Special Characters
    By hobartimus in forum v5.x
    Replies: 9
    Last Post: 02-28-2005, 03:41 AM
  5. Redirect needed
    By Compdoctor in forum v3.2
    Replies: 6
    Last Post: 05-22-2002, 10:46 AM

Posting Permissions

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