www.webdeveloper.com
Results 1 to 3 of 3

Thread: 404 redirect problems

  1. #1
    Join Date
    Jul 2010
    Posts
    3

    404 redirect problems

    Hi everyone,
    I've created a .htaccess file containing 301 redirects and the 404 redirect for a temporary site, the 301's work correctly but the 404 doesn't, yet both index.html and 404.html are in the same htdocs directory. The .htaccess file is placed 1 directory above in the parent directory.

    I'm new to .htaccess and would appreciate any help as to why the 404 doesnt work yet the 301 redirect does.

    Redirect 301 /careers.php http://www.example.com/newcareers.php
    Redirect 301 /contact.php http://www.example.com/contact_us.php
    ErrorDocument 404 /http://www.example.com/404.html

    The new site I'm working on is hidden in a sub folder, but strangely the 404 redirect points the user to the 'new' home page of the new site and not to the current 404.html page.

    Can anyone help?

    Thanks

  2. #2
    Join Date
    Dec 2005
    Posts
    2,984
    Code:
    ErrorDocument 404 /http://www.example.com/404.html
    Maybe it's because of the forward slash you accidentally placed before your http
    I've switched careers...
    I'm NO LONGER a scientist,
    but now a web developer...
    awesome.

  3. #3
    Join Date
    Jul 2010
    Posts
    3

    Smile Thanks but furhter help required

    Hi aj_nsc
    Thanks for the tip. Stupid of me.

    Also trying to reslove the following dynamic redirect. I've added code the htaccess file to test 1 redirect of:

    www.example.com/vessels.php?p=leviathon

    to

    www.example.com/leviathan.php

    with the following code:

    RewriteEngine On
    RewriteCond %{QUERY_STRING} ^p=leviathon$
    RewriteRule ^/vessels.php$ http://www.example.com/leviathan.php? [L,R=301]

    but for some reason it's NOT working??

    I'm new to this so any help would be appreciated

    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles