WordPress.org

Forums

[resolved] Change The Default Page (for 404?) (6 posts)

  1. mookus
    Member
    Posted 9 years ago #

    Howdy all!

    I'm thinking this is probably something extremely simple that I'm just not seeing - both of the following URLs load my blog's main page:

    http://www.themook.net/blog/
    http://www.themook.net/booboo.htm

    The page "booboo.htm" does not exist - when a browser requests a page that doesn't exist like that, I would like it to point to my main main page at:

    http://www.themook.net/index.php

    ...instead of my main blog page at:

    http://www.themook.net/blog/

    Is there an easy way to do this? When I couldn't find an option in WordPress admin I started trying to read up on .htaccess redirects etc., but frankly I'm not entirely following all that. WordPress gods throw me a bone? :)

  2. Samuel B
    moderator
    Posted 9 years ago #

    This tutorial should be exactly what you need:
    http://website-design.mcdar.net/47896.php

  3. mookus
    Member
    Posted 9 years ago #

    Thanks Samboll! All is well now :)

  4. mookus
    Member
    Posted 9 years ago #

    Rats, spoke too soon, what I thought had fixed it merely broke something else.

    After poring over lots and lots of websites and forums, I can finally at least understand the current WordPress .htaccess:

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

    Basically if something is requested that isn't a file or directory, the request is sent to '/blog/index.php' instead. But I don't want '404' requests going to the blog index page, I want it going to the main site page ... if I change '/blog/index.php' to just '/index.php' this solves the '404' page issue, but then all of my WordPress permalinks fail to resolve (because instead of going to 'blog/this-is-post', they go to simply '/this-is-post', which doesn't exist).

    Anyone follow all that enough to lend a hand? Does anyone know if it's at least possible, so I'm not just banging my head for nothing? :)

  5. Samuel B
    moderator
    Posted 9 years ago #

    How about something very simple that gives your visitors lots of options?
    Check out my 404:
    http://www.comeuphither.com/blog/fred (of course "fred" doesn't exist)
    Sitemap can be had here:
    http://www.dagondesign.com/articles/sitemap-generator-plugin-for-wordpress/

  6. mookus
    Member
    Posted 9 years ago #

    Oooh, Samboll, that does look really cool! :) I'll be using that for my WordPress stuff for sure. But my site has a lot of content outside the blog, i.e., lots and lots of pages that aren't 'Wordpress' pages, they're just good old fashioned html / php files. The WordPress blog is a small piece of the whole, but I feel like it's hijacking my htaccess lol. It makes sense for a '404' from 'mysite.com/blog/' to default to the WP index, but outside the blog directory I feel like a domain with WP installed should still be able to have it's own '404' system.

    I'm still on the mission :D

Topic Closed

This topic has been closed to new replies.

About this Topic