1

For my wordpress website plain permalinks are not working. The post url is changing but when we click on the post its not redirecting to the post page. It will be in the home page itself.

For example:

http://example.com/?p=14523

If I change the permalinks to other custom formats, it works correctly and showing the posts page. For example:

http://example.com/2018/09/01/postname/

I tried creating a new .htaccess file after changing the permalinks to plain. Still not working.

  • What does your htaccess look like, standard or did you customise it? – Nathaniel Flick Sep 2 '18 at 7:11
  • standard one # 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 – santosh hegde Sep 2 '18 at 7:41
  • basically wordpress default canonical permalink is not working. – santosh hegde Sep 2 '18 at 7:43
1

Plain permalinks of the form /?p=14523 (or /index.php?p=14523) don't necessarily need any .htaccess file since they don't require mod_rewrite to rewrite the URL (unlike the the custom permalinks you mention).

However, for a URL of the form /?p=14523 (as opposed to /index.php?p=14523), where you don't explicitly state the index document (ie. index.php) in the URL then the DirectoryIndex must be correctly set on your server. This can be achieved in .htaccess using the following directive:

DirectoryIndex index.php

Normally, this is set by default on most servers, but sometimes it is not.

0

delete .htaccess completely and reset permalinks, I have faced similar incidents it did the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.