WordPress.org

Forums

Permalinks not saving (10 posts)

  1. mattios550
    Member
    Posted 1 year ago #

    Hi,

    I just started a new WP installation and my permalink settings are not saving. I have chosen the 'Month and name' option (/2014/06/sample-post/), but when I create a new post, the text shows up as /2014/06/sample-post/, but the link goes to the default ?p=x. When I go to /2014/06/sample-post/ with the correct information for the post, I get a not found error. ?p=x works and shows the post.

    The changes appear to save successfully ('Permalink structure updated.')

    This is my .htaccess file:

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

    Thanks in advance for any help!

    Matt

  2. ClaytonJames
    Member
    Posted 1 year ago #

    Can your host confirm that mod_rewrite is functioning properly for your site?

  3. mattios550
    Member
    Posted 1 year ago #

    Hi,

    An administrator can create a post and it is given the permalinks that I would like.

    However, when a Contributor does it, the ?p=x setting is given.

    So I guess mod_rewrite is working?

    Thanks for your response.

  4. ClaytonJames
    Member
    Posted 1 year ago #

    but when I create a new post, the text shows up as /2014/06/sample-post/, but the link goes to the default ?p=x. When I go to /2014/06/sample-post/ with the correct information for the post, I get a not found error. ?p=x works and shows the post.

    That's usually symptomatic of an issue with mod_rewrite, if the .htaccess file is being written to with no problem.

    So I guess mod_rewrite is working?

    It doesn't seem like it based on the symptoms, but this is a bit odd..

    "An administrator can create a post and it is given the permalinks that I would like.

    However, when a Contributor does it, the ?p=x setting is given."

    I've never encountered those circumstances before.

  5. mattios550
    Member
    Posted 1 year ago #

    Thanks for your response ClaytonJames.

    I also have this code in my .htaccess:

    RewriteCond %{HTTP_HOST} ^site\.co\.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.site\.co\.uk$
    RewriteRule ^example$ "http\:\/\/site\.co\.uk\/system\/documents\/document\-1\.pdf" [R=301,L]

    Does that use mod_rewrite? Because the above works.

  6. ClaytonJames
    Member
    Posted 1 year ago #

    Does that use mod_rewrite? Because the above works.

    So it would seem. I might be overlooking something terribly obvious, but I still can't think of an explanation for this behavior:

    "An administrator can create a post and it is given the permalinks that I would like.

    However, when a Contributor does it, the ?p=x setting is given.

    Is there any info we might be overlooking about the installation itself that might lend a clue for anyone who might recognize the symptoms?

    - Is the new WordPress install located at the root of your domain, or in a sub-directory?

    - Is this a completely fresh installation, or have files from a different installation been copied to this new location?

    - Is there more than one .htaccess file involved anywhere in the directory structure?

    - Are you using it as a stand-alone site, or are you in the process of setting up a Network of sites?

  7. mattios550
    Member
    Posted 1 year ago #

    The wordpress install is in the root directory.
    It is a fresh installation.
    There is a .htaccess file in one or two subdirectories not related to the installation.
    I'm not sure, I think it is a stand alone site.

    This is the code at the start of my .htaccess:

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

    Should RewriteEngine On be used twice?

    Edit: I just changed the permalink setting to /archives/x and all roles use this structure. I changed it back to /year/month/name and it doesn't work again.

    When I edit the post as an Administrator, the correct structure is given. I tried 2 other structures but they did not work.

    Thank you for your help.

  8. ClaytonJames
    Member
    Posted 1 year ago #

    You're absolutely, 100% sure that when you update/change your permalink structure from: Dashboard > Settings > Permalinks, that WordPress is successfully writing the changes to the .htaccess file ?

  9. mattios550
    Member
    Posted 1 year ago #

    I have checked, and the .htaccess file does not change when I change the settings and apply them. The 'change successful' message still comes up though.

    Thank you for identifying the problem! Is there any way that it can be fixed, do you know?

    P.S. I have two WordPress installations on the same domain, one in the root and the old one in a subdirectory.

  10. mattios550
    Member
    Posted 1 year ago #

    I also checked again and all roles now use the same (wrong) default permalink setting.

    I also deactivated all plugins and the problem still occurs.

Topic Closed

This topic has been closed to new replies.

About this Topic