0

I hope someone can help me.

I am configuring my new Centos 7 server with directadmin and ran into the following problem(s);

  • my .htaccess file won't generate after saving permalinks, but says (Permalink structure updated.)
  • multisite wordpress gives an error 500 after trying to save site (no errors in log). I think this is to do with the same problem, why my htaccess won't generate. The htaccess just seems like an easier starting point for my question.

Things you need to know;

  • everything else seems to work in Wordpress. I can even download, install and activate plugins within wordpress
  • I allready run another Centos 6 directadmin webserver. So I have some knowhow.

Things I have tried:

  • delete the current .htaccess in hope it would be generated a new one
  • chown the .htaccess file to apache:apache
  • check file and folder permissions, even chmod 777
  • yum update
  • update directadmin
  • update custombuild and recompile
  • reset all configs to default
  • check if mod_rewrite is loaded and running
  • increased php memory_limit and executiontime
  • creating new ftp user and configured wordpress to use this other ftp user
  • deactivate and delete all wordpress plugins

There seems to be no consistency in my problem, because I would think it has to do with permissions for writing files. But installing new plugins works fine.

7
  • 1
    Have you tried to set the .htaccess file manually? The htaccess file is independent from the permalink structure, but it is depending on single/multisite. codex.wordpress.org/htaccess – ahendwh2 Jul 4 '18 at 9:40
  • WordPress will update the permalinks without always changing the htaccess, if you use the default WP htaccess, does your site still have a 500 error? Can the WP write to an empty .htaccess? – Aravona Jul 4 '18 at 9:41
  • Thanks for your help guys. Setting it manually works fine. But my problem is bigger. That's why I used htaccess as a starting point for my question. It won't even create a new one when I delete the htaccess. I think that is the problem, why my "add site" function won't work. even without htaccess, my "add site" doesnt work. It looks like if wordpress cannot create new files or folders. On the other side, installing plugins works fine. – FJJ Jul 4 '18 at 10:18
  • have you tried changing ownership cmd: ( sudo chown -R www-data:www-data dir_name ) for ubuntu ( sudo chown -R apache:apache dir_name ) for centos 7 Do this for whole wordpress site folder . – maverick Jul 4 '18 at 11:47
  • Do you have SELinux active if so, maybe this chcon -R -t httpd_sys_content_t /var/www/html/wordpress chcon -R -t httpd_sys_rw_content_t /var/www/html/wordpress helps? Adjust path to own needs of course. – Charles Jul 4 '18 at 12:50
0

Try adding the following to a manually generated .htaccess file

# 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

Without knowing more about the version of WordPress used & the setup of your web-server that's the ebst advice i can offer. Also, .htaccess should never be 777 permissions

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.