Setting up a website at www.####.com/blog

Discussion in 'Site & Server Administration' started by imnotadoctor, Aug 3, 2006.

  1. #1
    I was not sure where to ask this, but I want to setup my website at www.###.com/blog. So if anyone typed in www.###.com it would go to www.###.com/blog. Would this be just be a forward or not? If so I do not like this because i can not track reffering urls.

    I figured one of you would know.
     
    imnotadoctor, Aug 3, 2006 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    jestep, Aug 4, 2006 IP
  3. imnotadoctor

    imnotadoctor Well-Known Member

    Messages:
    415
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    140
    #3
    I am using a GoDaddy hosting service and can not find the section where I can setup the root directory.

    If I have to do a 301 redirect I need to do it with PHP. Where would I place this code? an index.php file?

    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.new-url.com" );
    ?>
     
    imnotadoctor, Aug 4, 2006 IP
  4. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #4
    I think something like this would work. Make a blank text file, and name it .htaccess. Make sure there is no .txt at the end of it.
    
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} !^www.domain.com/blog/ [nc]
    rewriterule ^(.*)$ http://www.domain.com/blog/$1 [r=301,nc]
     
    Code (markup):
     
    jestep, Aug 4, 2006 IP
  5. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #5
    Also, this one may be better. Also upload the .htaccess file to your root web directory.
    
    Options +FollowSymlinks
    RewriteEngine on
    rewriteCond %{REQUEST_URI}!^/blog/ 
    rewriteRule ^(.*)$ /blog/$1 [L,R=301] 
    
    Code (markup):
     
    jestep, Aug 4, 2006 IP
  6. [*-AnOnYmOuS-*]

    [*-AnOnYmOuS-*] Active Member

    Messages:
    253
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #6
    I believe GoDaddy hosting provides a Cpanel. In the Cpanel click the ->Redirections links and in there just add the redirections you want :rolleyes: .
     
    [*-AnOnYmOuS-*], Aug 4, 2006 IP
  7. imnotadoctor

    imnotadoctor Well-Known Member

    Messages:
    415
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    140
    #7
    There is not redirection. There is a 404 error redirections slot, but I tried that one and it does not work.
     
    imnotadoctor, Aug 4, 2006 IP