Support » Installing WordPress » “Pretty permalinks” and .htaccess> 404 Not Found Errors

  • Resolved HollyJahangiri


    I installed WordPress 2.7. I imported a Blogger blog and comments.

    So far, success – everything looks fine. BUT, when I try to change the permalinks to, and create an .htaccess file in the directory with index.php, containing the following lines:

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

    the posts ONLY show on the front page of the blog. If I click the title or try to add a comment, I get a 404 error. I can still see posts and comments from the Dashboard; clearly, everything’s still there.

    However, if I remove .htaccess and switch back to “default” permalinks, everything works fine.

    Any advice? This is quite frustrating. If it involves doing anything with the database, please use small words and straightforward declarative sentences; my knowledge of databases is…not extensive.

    The blog is here:

Viewing 14 replies - 1 through 14 (of 14 total)
  • delete the .htaccess
    regenerate your permalinks
    admin – settings – permalinks

    Doesn’t work. I get the following error on EVERY structure EXCEPT default:

    If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.

    That is without any .htaccess file. When I created one, it seems to have worked, somewhat – the post URLs were structured correctly, but the pages did not exist and gave a 404 error.

    There’s a similar thread under Troubleshooting, by the way – I’m not the only one having this problem.

    If your .htaccess file were writable, we could do this automatically, but it isn’t

    chmod .htaccess to 666
    update your permalinks
    chmod back to 644 for security
    it will work now

    Why will it work now, Samboll?

    I mean, I had an .htaccess file. I put those lines in it. The permalinks were updated, and looked fine, but when I clicked on the post title or comments links, I got a 404 Not Found error.

    What’s changed since then?

    Okay – look at it now. I’ll leave it broken for now, just to show what it’s doing (but I’m going to reset it to default within the hour – this is uglier than ugly permalinks).

    well I can only assume your server is not allowing symlinks for some reason
    try adding this to top of .htaccess

    Options +FollowSymlinks
    RewriteEngine on

    @hollyjahangiri, our situations certainly SOUND similar, except I never received the “if your .htaccess file were writable” message.

    If you can, in the thread I started, list out the plugins you have installed. I want to see if there are any that we are both using that might be causing the issue.

    Wait, I just went to your site, and it looks like you have it working. What was the solution?

    Right now it looks like its working. Is it fixed or did you just reset it?
    The first thing is as Samboll suggested is adding:
    Options +FollowSymlinks
    to the top of .htaccess. Normally it is on by default but some hosting companies have it off to screw with people.

    The idea about creating an empty htaccess with 666 permissions and then running permalinks from WP-ADMIN is because wordpress does most of its rewriting within WP itself and not in the htaccess. WHen you change certain things like the static pages or URL settings you usually need to again set the permalinks, so WP can set its internal rewriteting.
    Also do you have an .htaccess file in the directory above? Could possibly cause inheritance issues.
    Lastly what are the URL settings in WP?

    Hello… I realise this thread is near a year old…. but i was longing for a solution to be at the end of it! and cant see one… yet!

    I need to ressolve this same issue:
    default and blog ok
    permalink and blog gives 404 page not found (the link and the htaccess work ok… and i added (to the top of the htaccess) the bit mentioned earlier in this thread…
    this is what my .htaccess reads at momment:

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

    What else (and where) should i do?

    give a site link to see what you are talking about
    also, are you on a linux server?

    FOUND SOLUTION (for me):

    in the permalinks custom setting I had this:

    i removed the /index.php/ and just left it as this:

    Just thought would mention if may add an ”option to try” that may help someone in future

    Heya Folks,

    This worked for me, have a feeling it’ll be at the root of a lot of problems here.

    If, like me, your .htaccess file didn’t seem to be making a blind bit of difference no matter what was in it and adding RewriteEngine On didn’t help then maybe you need to look at your vhosts.

    Mine had AllowOveride set to ‘None’, this means that .htaccess files for the domain were not observed or allowed to override the functionality set by the vhost. You need to set it to something else, in my case I set it to ‘All’.

    sudo nano /etc/apache2/sites-available/

    <Directory "/path/to/your/app">
      Options FollowSymLinks
      AllowOverride All
      Order allow,deny
      Allow from all

    Then disable and re-enable the site and reload apache 🙂

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘“Pretty permalinks” and .htaccess> 404 Not Found Errors’ is closed to new replies.