3

I've changed my permalinks to a custom one. When I saw my contact page was sitting on [domain]/index.php/contact instead of [domain]/contact this isn't isolated to /contact however. I went and deleted the index.php in the custom string. This came up with of course [domain]/index.php/contact redirecting to [domain]/contact. However this came up with a 404 error page doesn't exist.

I went and checked and the .htaccess file did not exist so I enabled htaccess and created the file with vim empty then changed the permissions with chmod to 644 as stated the Wordpress Codex. Went and re-saved the permalinks to discover I still had a 404 error, this is when I noticed that WordPress still thought the .htaccess file was not writable.

I went and copied the .htaccess file text WordPress wanted me to manually add to the .htaccess file manually. To my anger, still producing a 404 error.

Does anyone know what could be causing this? I've never had this issue before. What is happening?

  • 2
    Does your server meet the requirements for pretty permalinks - Apache web server with the mod_rewrite module installed, FollowSymLinks option enabled, FileInfo directives allowed? – Milo Aug 9 '18 at 2:50
  • .htaccess files or mod_rewrite might not be enabled on your server... 1. Try putting any nonsense at the top of your .htaccess file - do you get an error? (You should get a 500 Internal Server Error.) 2. Try removing the <IfModule mod_rewrite.c> wrapper - do you get an error? – MrWhite Aug 9 '18 at 8:03
  • 1
    @MrWhite I do have it enabled. Getting a 500 error when I write garbage. – Liam O'Luachra Aug 9 '18 at 8:36
  • What about No.2 - remove the <IfModule mod_rewrite.c> wrapper? Or include RewriteEngine On at the top of the .htaccess file, above the <IfModule> wrapper? – MrWhite Aug 9 '18 at 8:54
  • @MrWhite Tried it, still get a internal error. – Liam O'Luachra Aug 9 '18 at 9:10
1

...remove the <IfModule mod_rewrite.c> wrapper? Or include RewriteEngine On at the top of the .htaccess file, above the <IfModule> wrapper?
:
@MrWhite Tried it, still get a internal error.

That indicates that you don't have mod_rewrite installed on your server or you are not permitted to use mod_rewrite in .htaccess files (see the AllowOverride directives for the later) - that will explain why the permalinks are not working.

With the <IfModule mod_rewrite.c> wrapper in place then the directives are simply not processed when mod_rewrite is not installed. It fails silently.

See the following StackOverflow question regarding enabling this: https://stackoverflow.com/questions/869092/how-to-enable-mod-rewrite-for-apache-2-2

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.