WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Perma links leading to 404 (22 posts)

  1. HTT
    Member
    Posted 7 years ago #

    I have wordpress installed in my root folder and instead of my links being the default setting I decided to customize the permalink structure to this: /%year%/%monthnum%/%day%/%postname%/

    That's great but going back to my homepage none of the links work, they all go to 404 pages - check for yourself:

    http://www.newcastle-online.com/

    I'm thinking it has something to do with my general settings which at the moment appear like so:

    WordPress address (URI): http://www.newcastle-online.com/
    Blog address (URI): http://www.newcastle-online.com/

    What am I doing wrong? I don't want to mess about too much as I'm not too clued up with all this sort of thing and I don't want to break WordPress or lose data so some pointers would be greatly appreciated, thanks.

    BTW when I change permalinks back to default setting, the links work again.

  2. Chris_K
    Member
    Posted 7 years ago #

    Some good troubleshooting stuff on the Permalinks page.

    In particular, confirm with your host that mod_rewrite and AllowOverride are both on and enabled.

  3. HTT
    Member
    Posted 7 years ago #

    My htaccess file reads:

    RewriteEngine On
    RewriteRule x.html y.html

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

    # END WordPress

    Does that mean its enabled and on?

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    And if you go to x.html, do you actually get y.html?

  5. HTT
    Member
    Posted 7 years ago #

    I don't know what you mean, sorry.

  6. Chris_K
    Member
    Posted 7 years ago #

    Your .htaccess has this line:

    RewriteRule x.html y.html

    If you have mod_rewrite working, browsing to http://yourdomain.com/x.html should result in display y.html.

    If you create an x.html and a y.html file and upload them, does it?

  7. HTT
    Member
    Posted 7 years ago #

    I've just created both y and x.html files uploaded them and when I type them into my browser I get those files and not switched around, does that mean I don't have mod-rewrite enabled on my server?

  8. HTT
    Member
    Posted 7 years ago #

    Still no nearer to solving this, does anyone have any ideas? We have modrewrite turned on. The thing is, it was working on the old server, only when we moved has it started doing this yet the paths are all correct, everything.

  9. Chris_K
    Member
    Posted 7 years ago #

    I went to your x.html. If your mod_rewrite was working, your server should've presented me with y.html.

    It didn't.

    Thus, the other piece I suggested: Check with your host and make sure AllowOverride is enabled for your domain.

  10. HTT
    Member
    Posted 7 years ago #

    Hi Solo, thanks for your reply. Just fired this thread off to the server guys. My spellchecker, anti-spam comments images and my imagemanager aren't working either, could this be down to mod_rewrite do you think, too, like with the permalinks?

  11. Chris_K
    Member
    Posted 7 years ago #

    It's conceivable that those are all related.

    If you visit Options -> Permalinks and set 'em to "Default", do any of the other things start working?

  12. HTT
    Member
    Posted 7 years ago #

    No they don't, they don't work for any comination of permalink set up strangely enough. I'll get my server team to take a look at the other things or I'll uninstall them and reinstall them as I've read from others who've moved servers of having success that way.

  13. HTT
    Member
    Posted 7 years ago #

    Hmm, my current settings in "Options", "General" are:

    WordPress address (URI): My full domain name
    Blog address (URI): My full domain name

    Now if I change the Blog address URI to this: http://www.newcastle-online.com/index.php

    And then go to "Permalinks" in "Options" and set it to this: "Date and name based"

    My Permalink structure looks like this: http://www.newcastle-online.com/index.php/2006/10/21/sample-post/

    But when I press Update a blue warning says: You should update your .htaccess now.

    And at the bottom the following is printed out:

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

    What do I do?

    That is the structure I want but without the index.php bit in so it just does this instead: http://www.newcastle-online.com/2006/10/21/sample-post/

  14. HTT
    Member
    Posted 7 years ago #

    Also, clicking http://www.newcastle-online.com/2006/10/21/sample-post/ takes me to a server generated 404 where as clicking http://www.newcastle-online.com/index.php/2006/10/21/sample-post/ takes me to a WordPress generated 404

    Am I getting close to what is the problem or is this just even more problems?

  15. Chris_K
    Member
    Posted 7 years ago #

    Ok, you're on the right track...

    First off, remove index.php from your Options -> General settings.

    Head back to Options -> Permalinks and set your permalinks as desired. Presumably, you'll get that warning again. That's WP telling you that it can't write to the .htaccess file (or create one).

    So, look in your blog directory for the file (it's hidden, so if using an FTP client, make sure you tell it to show hidden files). If you don't find it, create one and upload it with the contents that WP told you to put in there. If there is one there, just add that block of code.

  16. HTT
    Member
    Posted 7 years ago #

    I did what you said but this time it didn't say I needed to update htaccess, it says Permalink structure updated.

    But going back to my site the links head to 404s again, not WordPress generated 404s but server ones.

    For example: http://www.newcastle-online.com/2006/10/20/a-message-to-newcastle-fans-from-palermo-fans/

    What does that mean?

  17. moshu
    Member
    Posted 7 years ago #

    Are you 120% sure you removed the index.php fromm the two URI values in the Options > General?
    It doesn't look like that...

  18. Chris_K
    Member
    Posted 7 years ago #

    Do you have a .htaccess in your blog's directory? If so, what's in it?

    This could go back to my second post in this thread:

    In particular, confirm with your host that mod_rewrite and AllowOverride are both on and enabled.

    Your host needs to answer those questions...

    You might try, for grins, "almost pretty" Permalinks. On the Permalinks page, select custom and specify something like:
    index.php/%year%/%monthnum%/%day%/%postname%/

  19. HTT
    Member
    Posted 7 years ago #

    Moshu, yep removed it.

    Handysolo, this is what my htaccess file in my root says:

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

    There is another htaccess file that says:

    #AddType text/x-server-parsed-html .html
    RewriteEngine On
    RewriteRule /x.html /y.html

    That one is called .htaccess-

    ???

  20. HTT
    Member
    Posted 7 years ago #

    Went with almost "almost pretty" for now.

  21. HTT
    Member
    Posted 7 years ago #

    Fixed fellas, thanks for all your help, yous are superstars. The server team fixed it so I assume it was this:

    AllowOverride + Mod_rewrite

    Again, many thanks.

  22. prokihun
    Member
    Posted 7 years ago #

    no, it was not solved, at least I couldn't figure out a word. but at godaddy it has a much more prosaic explanation. in the root there is a file called missing.htm. until you don't delete it you will always get this file as wrong installation message (in case of root installation)! of course, at first I made it sure that wordpress make the .htaccess file but she did it. so go ahead and don't lose as many time as I did.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags