WordPress.org

Ready to get started?Download WordPress

Forums

New install WP 3.4.2 - can't set permalinks (16 posts)

  1. Dakota XT
    Member
    Posted 1 year ago #

    Just done a new install of 3.4.2 this weekend and have now been working on it for 2 days, just trying to change the permalinks.

    This was originally and upgrade of an existing site, but because we've had so much trouble setting it up, and because there were only a few pages on it, we have trashed the site whole site twice and done two fresh installations and still can't get it working.

    The htaccess file did not create automatically, so I copied one over from another site where permalinks do work. Every time I try to reset permalinks, the htaccess file is stripped out.

    Any ideas?

  2. Dakota XT
    Member
    Posted 1 year ago #

    I suspect this is is a server configuration issue.

    We've spent a couple of hours talking to the support techs today (eUKHost) and they insist it is not them - it is a WP problem! However, two other installations on other servers (not with eUKHost) we have no problems with, which they refuse to acknowledge - it's still a WP problem.

    Before anybody suggests moving this particular site, we are transferring all our sites slowly away from eUKHost, but this is a long slow process and this particular site cannot be moved at this time.

    If anybody has the magic solution to this, it would be very much appreciated :).

  3. JungleSpace.net
    Member
    Posted 1 year ago #

    What are your steps to resetting the permalinks?
    What do you meant by the htaccess file is stripped out?

  4. Dakota XT
    Member
    Posted 1 year ago #

    Setting permalinks:
    Admin > Settings > Permalinks > select Post name > Save Changes
    After that /options-permalink.php/ remains in the url so you cannot navigate to anywhere else in the admin unless you delete that part of the url.

    htaccess goes from:

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

    # END WordPress

    to

    # BEGIN WordPress
    # END WordPress

  5. JungleSpace.net
    Member
    Posted 1 year ago #

    Does the Setting > Permailinks still shows Post name selected?

    If you're comfortable with php, you may try to follow the trail in the mod_rewrite_rules() function.

    Hope you're working on a fresh installation, not sure whether some plugins might interfere.

  6. Dakota XT
    Member
    Posted 1 year ago #

    No, it refers back to default, puts /options-permalink.php/ in the url which stays there rendering it impossible to navigate through the admin because anywhere you try to navigate to for example would be:

    http://sitename/wp-admin/options-permalink.php/edit.php

    I've changed permissions on files, checked the db_version is 21707, checked with hosting the mod_rewrite is active and the rules are set as defined.

    I'm happy for anybody to throw any php at me, database setup etc. We've done more than 50 WP installations and never seen this before.

    Yes, it's a fresh install (Database and WP) no plugins, nada.

  7. esmi
    Forum Moderator
    Posted 1 year ago #

    so I copied one over from another site where permalinks do work.

    Bad idea. You need to create a fresh .htaccess file based on the code that WP provides when it cannot create the .htaccess file itself.

  8. Dakota XT
    Member
    Posted 1 year ago #

    Please read above code - it IS what WP provides :)

  9. esmi
    Forum Moderator
    Posted 1 year ago #

    It was apparently what WP provided for another site. The rewrite rules are often site specific.

  10. Dakota XT
    Member
    Posted 1 year ago #

    Sorry I'm confused now. Are you saying that the code recommended by WP on http://codex.wordpress.org/Using_Permalinks is wrong?

  11. esmi
    Forum Moderator
    Posted 1 year ago #

    The rewrite rules on that Codex page are just an example. I am saying that you cannot always safely used the .htaccess file from one site in another site.

  12. Dakota XT
    Member
    Posted 1 year ago #

    I think I may not have explained myself properly. I can see why you thought I had taken the file from one site and transferred it into another. Just to clarify, I created a new .htaccess file, opened a existing file on another WP site I have on the same server and copied and pasted the code. Which is exactly the same as the code WP recommend using, and is also the same as that used on numerous other sites I've set up. This is the first time I have ever come across this problem setting up permalinks. Since I did 2 other installations on another server on the same day, I can't figure out why does this one does not work, thus suggesting this problem is more to do with a server configuration issue.

  13. JungleSpace.net
    Member
    Posted 1 year ago #

    Try this debug code in the wp-includes/rewrite.php file.

    function set_permalink_structure($permalink_structure) {
    		if ( $permalink_structure != $this->permalink_structure ) {
    			update_option('permalink_structure', $permalink_structure);
    			$this->init();
    //Start Debug
    echo '<pre>';
    print_r($this->permalink_structure);
    echo '</pre>';
    //End Debug
    			do_action('permalink_structure_changed', $this->permalink_structure, $permalink_structure);
    		}
    	}
  14. Dakota XT
    Member
    Posted 1 year ago #

    Thanks for the suggestion, I will try it but we know the permalinks aren't being set in the database and the htaccess file is being reset when you try and save the new permalink structure in admin. It will probably be the weekend before I can look into it again but will let you know if I have any success.

  15. JungleSpace.net
    Member
    Posted 1 year ago #

    Do turn on the WordPress debug mode.

    http://codex.wordpress.org/Debugging_in_WordPress

  16. ricardusexa
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags