+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: domain page redirect: another easy newbie problem(i hope)

  1. #1
    Join Date
    Nov 2008
    Location
    United States
    Posts
    15

    Unhappy domain page redirect: another easy newbie problem(i hope)

    I want to redirect some old pages that are no longer "real" to my new site. I went through cpanel redirect, chose the correct domain, and input the new info. But the pages are still coming up with the "404 page not found" message when browsed to.

    I want to move these pages:
    www.unrequited-love.com/index.html
    www.unrequited-love.com/url_001.htm
    www.unrequited-love.com/url_004.htm
    www.unrequited-love.com/url_005.htm

    to just http://www.unrequited-love.com/

    I've also cleared my cache but it didn't seem to help. Any suggestions?

    Thanks,
    Lonesome Loser

  2. #2
    Join Date
    Nov 2008
    Location
    United States
    Posts
    15

    Default

    Hi, it's me again...So, I searched the forum more and found advice regarding repointing pages via .htaccess. I edited my .htaccess file in Notepad in following fashion as suggested:

    Redirect 301 /index.html http://www.unrequited-love.com

    When I reloaded the file via FileZilla, I couldn't access my site at all, got some kind of "infinite loop" message. So, I went back to .htacess and took out my edits and my site works again, but I really don't understand how to get my pages to point right, can anyone help me out?

  3. #3
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    4,533

    Default

    That's because the domain itself is set to display the index.html page of no page is specified. The redirects should work for your other pages though.

  4. #4
    Join Date
    Jan 2008
    Location
    cardboard box
    Posts
    388

    Default

    Do you only want these specific pages to redirect to your home page, or do you want your 404 page to redirect there?
    Have you tried turning it off and on again?

  5. #5
    Join Date
    Nov 2008
    Location
    United States
    Posts
    15

    Default

    Hi WYSIWYG, thanks for answering. Great question, I want the 404 page (which comes up for all those pages) to redirect to www.domain.com

    Also, I need to get domain.com to redirect to www.domain.com. (I'm losing a lot of traffic to domain.com then they give up or get frustrated and leave). I've already tried the two solutions below suggested by two recommended tutorials. Any other suggestions?

  6. #6
    Join Date
    Nov 2008
    Location
    United States
    Posts
    15

    Default

    Oops, , the two solutions below, in separate attempts via htaccess:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www.unrequited-love.com
    RewriteRule (.*) http://www.unrequited-love.com/$1 [R=301,L]

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^unrequited-love.com [NC]
    RewriteRule ^(.*)$ http://www.unrequited-love.com/$1 [L,R=301]

  7. #7
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    4,533

    Default

    Redirecting all not found errors to your home page just requires:

    Code:
    ErrorDocument 404 http://www.unrequited-love.com

  8. #8
    Join Date
    Nov 2008
    Location
    United States
    Posts
    15

    Default

    Hi Felgall, thanks for helping. I tried the solution you recommended, but it doesn't seem to work. Here's what's in my htaccess file if you have time to take a look:

    # Use PHP5 as default
    AddHandler application/x-httpd-php5 .php

    RewriteEngine on

    ErrorDocument 404 http://www.unrequited-love.com

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

  9. #9
    Join Date
    Jan 2008
    Location
    cardboard box
    Posts
    388

    Default

    Actually, the wordpress code in there already rewrites queries to nonexistant files and directories to the index.

    What you need to do is edit the 404 page for your current theme through the wordpress admin panel.

    A simple redirect to your home page can be accomplished like this..
    PHP Code:
    <?php
    header
    ("HTTP/1.1 301 Moved Permanently");
    header("Location: ".get_bloginfo('url'));
    ?>
    If you can't get at the 404 template through the theme manager thing you'll need to edit or create the 404.php file manually in the current theme's folder (/wp-content/themes/xxxxxx/404.php).
    Have you tried turning it off and on again?

  10. #10
    Join Date
    Nov 2008
    Location
    United States
    Posts
    15

    Default

    Ok, I tried that but got this output on 404 page. Is there a particular place I need to put the code?

    Output:
    Warning: Cannot modify header information - headers already sent by (output started at /home4/unrequi1/public_html/wp-content/themes/lunatic-fringe/header.php:5) in /home4/unrequi1/public_html/wp-content/themes/lunatic-fringe/404.php on line 6

    Warning: Cannot modify header information - headers already sent by (output started at /home4/unrequi1/public_html/wp-content/themes/lunatic-fringe/header.php:5) in /home4/unrequi1/public_html/wp-content/themes/lunatic-fringe/404.php on line 7
    I'm Sorry, This Page Does Not Exist However, you may find what you are looking for elsewhere on this site by clicking on the "Home" button in the horizontal menu above.

+ Reply to Thread

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