Complex 301 htaccess redirect

Discussion in 'HTML & Website Design' started by diarmuid, Jun 6, 2007.

  1. #1
    Hiya everyone,
    Ok, I have pretty much managed to do all of the coding, however I have now come across a problem with some redirects, I was trying to create a 301 htaccess redirect. I need it to basically send any links to the domain of:
    http://parteneo.net to www.parteneo.net/index.shtml.

    What I was trying to do was to redirect http://parteneo.net to www.parteneo.net and then any URLS going to www.parteneo.net to be redirected to www.parteneo.net/index.shtml

    I hope that makes sense, and I did try a search on google, but I was unable to find something which combined not only a redirect to index.shtml, but also bringing http://parteneo.net across to the www. version of the site.

    Thank you very much for your help!
     
    diarmuid, Jun 6, 2007 IP
  2. excaliburwebdesigners

    excaliburwebdesigners Peon

    Messages:
    501
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Presuming you have a linux server with mod-rewrite this should work

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^parteneo.net [nc]
    rewriterule ^(.*)$ http://www.parteneo.net/$1 [r=301,nc]
     
    excaliburwebdesigners, Jun 6, 2007 IP
  3. diarmuid

    diarmuid Peon

    Messages:
    285
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ok,with that I get the first part, it redirects from non www to www, so thank you. However, and this may have been my fault in explanation, however because the site needs to be iframed, what I am trying to do is redirect all incoming URLs from search engines to index.shtml, so that they get the iframe correctly.

    Thanks
     
    diarmuid, Jun 6, 2007 IP