Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2006
    Location
    Kepler 62f
    Posts
    14,877

    some .htaccess help?

    I'm trying to learn htaccess, but I'm having issues wrapping my head around this. I need to learn by example. Have several types of 301 permanent redirects that are needed.

    Want to redirect a single page to a new page
    OLD - http://www.domain.com/page.html
    NEW - http://www.domain.com/newfolder/page.html

    Want to redirect a folder, AND any pages in it (preferably without naming EACH page), to a new folder's index
    OLD - http://www.domain.com/oldfolder/lots-of-html-pages
    NEW - httr://www.domain.com/newfolder/index.html

    Want to redirect a subdomain to the primary domain
    OLD - http://web.domain.com
    NEW - http://www.domain.com

    Want to redirect a folder, AND any pages in it, to a new subdomain
    OLD - http://www.domain.com/folder/pages.html
    NEW - http://newsite.domain.com/folder/pages.html

    Using ISAPI_Rewrite 3 on 2003/IIS6, which uses htaccess commands.

    Could anybody here show me what they would do in these scenarios?

    I've read and read, and tried and tried, but it never seems to work out correctly. It either fails to redirect, or it redirects too much (some "open" type commands with a lot of variables will pick up the keyword -- for example, "students" -- so students.domain.com AND domain.com/students AND domain.com/program/students.html would all redirect, even though I only wanted the subdomain version, or the page version, to redirect, and not the others!).

    Thanks for reading. More thanks for your suggestions.

  2. #2
    Code:
    Redirect 301 /page.html http://www.domain.com/newfolder/page.html

  3. #3
    Join Date
    Feb 2006
    Location
    Kepler 62f
    Posts
    14,877
    Thanks, but that line of code does not work with ISAPI_Rewrite

  4. #4
    Sorry...

    Try this:
    [ISAPI_Rewrite]
    RewriteRule /page\.html http\://www.domain.com/newfolder/page.html [I,RP]

Posting Permissions

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