Announcement

Collapse
No announcement yet.

htaccess from old php site to Actinic

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    htaccess from old php site to Actinic

    I need to set up a 301 redirect from an old non Actinic php site to the root homepage of a new Actinic site.

    For example I need to redirect pages such as these:
    www.myolddomain.com/products.php?cat=1
    www.myolddomain.com/product.php?id=10
    www.myolddomain.com/buy.php

    all to the homepage of:
    www.mynewdomain.com

    The following works to a degree:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www\.)?myolddomain\.com(.*)
    RewriteRule (.*) http://www.mynewdomain.com/index.html [R=301,L]

    but I end up with this URL:
    http://www.mynewdomain.com/?id=105

    Obviously I don't want the ?id=105 on the end.

    Any htaccess fundis out there who can help me not loosing the last of my hair?

    #2
    Duncan,

    is the problem with the first part of the line
    I get a feeling that the * says "and everything else" and also does NOT change the address within the browser.
    by using the "+" sign, I think it also changes the address bar and encourages the users to use the new address.
    do you need to use
    Code:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^(.+)\.htm$ http://www.mynewdomain.com/index.html [R,NC]
    this one will handle htm and html, but the principal's the same

    i often get confused, but theres a couple of sites I always go looking at whenever I want to play with htaccess

    http://corz.org/serv/tricks/htaccess.php
    and another page on the same website
    http://corz.org/serv/tricks/htaccess2.php
    the first link is the intro, and the real meat goes on on the second link

    theres a very useful one at
    http://www.randomsequence.com/articl...xcept-your-ip/
    that shows you how to re-direct everyone else EXCEPT yourself, useful for testing.

    kev

    Comment


      #3
      oh, and I forgot a nice german site
      http://cooletips.de/htaccess/
      this one allows you to click on the checkboxes, fill a few fields out and it will make the htaccess file for you.
      it may be useful

      and of newbies, be careful, you can lock yourself out of your website with the wrong htaccess file
      kev

      Comment

      Working...
      X