301 Redirect htaccess question?

Discussion in 'HTML & Website Design' started by fuzzbuzz, Feb 27, 2008.

  1. #1
    Hi,

    I have 1 domain only, but i'd like the domain name : www.domain.co.uk to point to a particular page eg: www.domain.co.uk/start/index.htm

    What code to i use?

    I've seen code that uses just a slash ( / ) but wont that move everything from the domain where i want it to go?

    At the moment when people click on www.domain.co.uk there is one of those scripts php i think that redirects it, but there is a 1 second delay, so i'd like to change it on a permanent basis with the 301.

    Any help appreciated.

    Regards

    FB
     
    fuzzbuzz, Feb 27, 2008 IP
  2. dspohn23

    dspohn23 Peon

    Messages:
    370
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this:

    
    RewriteEngine On
    
    rewritecond %{http_host} ^www.domain.co.uk [nc]
    rewriterule ^$ http://www.domain.co.uk/start/index.htm [r=301,nc]
    Code (markup):
     
    dspohn23, Feb 27, 2008 IP
  3. fuzzbuzz

    fuzzbuzz Active Member

    Messages:
    315
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #3
    dsp

    thanx :)

    i shall try that
     
    fuzzbuzz, Feb 28, 2008 IP
  4. fuzzbuzz

    fuzzbuzz Active Member

    Messages:
    315
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #4
    i tried that but it didnt work

    instead all files and folders of my directory appeared.

    Any suggestions?

    thankz
     
    fuzzbuzz, Feb 28, 2008 IP
  5. CanaryWoolf

    CanaryWoolf Peon

    Messages:
    114
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You need to produce an index.html file in the root file (as that is were your browser and search bot will automatically look)

    Use this code for the page:
    
    <html>
    <head>
    <meta HTTP-EQUIV="refresh" content="0;URL=start/index.htm">
    <title>Put the website name here</title>
    <meta name="Classification" content="Internet">
    <meta name="Robots" content="noindex,follow">
    <meta name="Pragma" content="no-cache">
    <meta name="Language" content="en">
    </head>
    </html>
    Code (markup):
     
    CanaryWoolf, Feb 28, 2008 IP