.htaccess help, non www->www + old->new redirects

Discussion in 'Apache' started by ziplock122949, Jun 3, 2008.

  1. #1
    I am having a little problem getting the old links to redirect to the new locations using the htaccess file. Here is a little clip of what I have (everything is working except the last rule).

    Options +FollowSymLinks 
    RewriteEngine on 
    rewriteCond %{HTTP_HOST} ^mydomain\.com$
    rewriteRule ^.*$ http://www.mydomain.com%{REQUEST_URI} [R=permanent,L] 
    rewriteRule ^index\.(php|html|htm|asp|aspx) http://www.mydomain.com/ [R=permanent,L]
    rewriteRule ^/links/test.html http://www.mydomain.com/links/test.php[R=permanent,L]
    PHP:

     
    ziplock122949, Jun 3, 2008 IP
  2. Phooey

    Phooey Active Member

    Messages:
    413
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    80
    #2
    Is the last rule not working at all, incorrectly forwarding the link, or giving an error when attempting to access that link?
     
    Phooey, Jun 3, 2008 IP
  3. ziplock122949

    ziplock122949 Active Member

    Messages:
    159
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #3
    the last rule is not working at all. It is just giving a 404 error and the url stays as the old url.
     
    ziplock122949, Jun 3, 2008 IP
  4. ziplock122949

    ziplock122949 Active Member

    Messages:
    159
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #4
    anyone have any ideas?
     
    ziplock122949, Jun 5, 2008 IP