WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Page not Found After Changing Permalink to /%postname%/ (15 posts)

  1. nihilator
    Member
    Posted 4 years ago #

    My Blog is working great before I change the permalink to /%postname%/. I have only started this blog last week and only have test posts so I am not afraid in changing the permalink

    However, none of my test posts appear to be ok. They are all "page not found". But when I change back to default permalink, its all ok again.

    I had changed the .htaccess to the one in the WordPress Codex. Actually i added mine cuz there is no .htaccess on my server.

    here what i put in my .htaccess

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} ^wp-content.*
    RewriteCond %{REQUEST_FILENAME} ^wp-admin.*
    RewriteCond %{REQUEST_FILENAME} ^wp-include.*
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    And changed the permission of that file to Full Control but still I can't get my post.

    Any suggestions? Tips? thanks

  2. This what should be in your htaccess:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
  3. nihilator
    Member
    Posted 4 years ago #

    Hey man, thanks for the reply. Though it still didn't work.

    What I did is that i changed the custom structure like this:
    /index.php/%postname%/

    instead of just /%postname%/

    but it has the index.php in it like:

    http://www.example.com/index.php/the-name-of-post

    which I don't know if that's good or if that is SEO friendly (I doubt it).

    At least I can see my posts. But if anyone has a great idea of what my problem is, please help.

    thanks.

  4. Who's your webhost? I know that some sites (Yahoo! is one) require you to have the index.php

  5. enricooo
    Member
    Posted 4 years ago #

    Hi guys,
    I have a similar problem: when I activate the permalink (any of them) the main page is not available (404). I deactivate the permalink and it start to work again perferctly. Any ideas? Thanks! E

  6. nihilator
    Member
    Posted 4 years ago #

    I just confuse myself with my own post-

    @songdogtech - What I meant was even though i replaced the .htaccess by the one you posted, it still didn't work. So what I did instead, i changed the custom structure like the one above. It worked but it has the index.php in the beginning (obviously since i put it in).

    I don't know why it won't work with just /%postname%/ as the custom structure. I hope there are some other options. by the way, I am using Parallels Plesk Panel and I can't change the permission on my core FTP so I need to go the the plesk panel and change it at the file manager and Im sure I made it all permissions to full control.

  7. nihilator
    Member
    Posted 4 years ago #

    Hi Ipstenu -

    I'm in the philippines so i use the ones which are available in here. maybe i need to check it with my webhosting. So you mean some web hosting really require the index.php? So there's no way they can change that? if that's the case, that would really suck.

    @enrecooo

    - man, you tried including the index.php like the one i posted above?

    /index.php/%postname%/

    try it and then see if you can get your post done. What is your web hosting company? maybe we have the same issue.

  8. This is what http://codex.wordpress.org/Using_Permalinks says:

    For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text "page slug" as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties). So, it is best to start your permalink structure with a numeric field, such as the year or post ID.

    And this thread points out problems with using /%postname%/.

    And including index.php just makes it stranger; why do you want to include that?

  9. nihilator
    Member
    Posted 4 years ago #

    I don't actually want to include the index.php. But it works when I did and i think its the most possible custom structure i can use if none of this work.

    Anyway, i tried with the link that you posted and changed it like this;

    /%post-id%/%postname%

    but it just make the pages worst. Its a bad URL on the links and the contents on the pages are scattered.

    This permalink system is really hard. Why didn't they make it a default as /blog/postname.

  10. hpguru
    Member
    Posted 4 years ago #

    %postname% is good, i use it on my Mediablog without any problem.

  11. shownomercy
    Member
    Posted 4 years ago #

    They don't make pretty permalinks the default because many shared hosts do not have the required server module.

  12. nihilator
    Member
    Posted 4 years ago #

    Problem Solved in here. I made a 404 page that will direct all "Page not found" in that html page. here is the code for the 404 page

  13. nihilator
    Member
    Posted 4 years ago #

    Problem Solved in here. I made a 404 page that will direct all "Page not found" in that html page. You need to create a file called "wp-404-handler.php" and put it in your admin panel. In my case, I'm using Plesk Panel. I put it at:

    Domains>Web Directories>Error Documents

    and then chose 404 Not found file. Change the type to URL and change the location to: /blog/wp-404handler.php

    and then I put the wp-404hander.php to my blog installation directory: /blog

    here is the code for the wp-404handler.php:

    <?php
    $_SERVER['REQUEST_URI'] = substr($_SERVER['QUERY_STRING'], strpos($_SERVER['QUERY_STRING'], ':80')+3);
    $_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
    include('index.php');
    ?>

    My /%postname%/ custom permalink now works but when I go to my http://www.example.com/blog, I get the no post found which is in my single.php section. I can access though the blog url at http://www.example.com/blog/index.php which I think is ok since it is only the home for the blog and not the pages.

    here is the source and here

  14. akkaralol
    Member
    Posted 4 years ago #

    If your wordpress installation is in a directory other than the root, see my post here, it fixed the issue for me http://wordpress.org/support/topic/246738?replies=12#post-1329912

    Basically, in your .htaccess file, change
    RewriteBase /
    to
    RewriteBase /your_wordpress_directory/
    and also change
    /index.php
    to
    index.php

  15. Photorestorationman
    Member
    Posted 4 years ago #

    I have a similar but different issue, I changed my permalink from

    /index.php/%postname%/ to /%postname%/ and now in Google webmaster tools it tells me I have 52 duplicate title tags and lists all of my blog pages twice, each url is duplicated in the new permalink style as well as the old one. In my experience this can upset the placement of your site by not being all cuddly with what Google wants. Has anyone else checked their Google account recently after changing their permalinks and do you have the same problem?

    How to fix it that is the question?

    Thanks if anyone can help

    Neil

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags