Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make .htaccess writeable for wordpress? [closed]

I have Wordpress running on a dedicated centos server with Buddypress installed . Buddypress requires pretty permalinks. Therefore I changed i to /%postname%.

Somehow it did not work because Buddypress is not working correctly and Wordpress suggests to create the .htaccess myself :

"If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all."

I have tried every hint I found but somehow it does not work. Here is a list:

  • mod_rewirte is enabled
  • .htaccess was created and filled with wordpress suggested information
  • .htaccess was set to chmod 777
  • FollowSymLinks and AllowOverride All was set in the httpd.conf

Is there anything else I can do?

Thanks in Advance

like image 983
sil0r Avatar asked Jan 08 '23 02:01

sil0r


1 Answers

None of those things will make a difference if your ownership is wrong. The reason wordpress can't write to it is because the file is probably owned by another user instead of web server. I've seen this numerous times.

To fix this issue, first change the permission back to a more secure permission using this from the command line.

chmod 644 .htaccess

Then change the ownership/group of the .htaccess file to web server user.

For CentOS/RHEL

chown apache: .htaccess

For Ubuntu/Debian

chown www-data: .htaccess

Now wordpress should be able to right to this file.

like image 184
Panama Jack Avatar answered Jan 15 '23 06:01

Panama Jack