Report this

What is the reason for this report?

Changing Wordpress Permalink Settings

Posted on October 16, 2014

I’m attempting to change the permalink settings within Wordpress, but when I change it from the default to ‘post name’ I get the following error:

“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.”

The ‘field’ contains the following text:

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

My system:

I’ve installed the latest Wordpress using the ‘one-click’ install DigitalOcean offers on top of an Ubuntu 14.04 LAMP droplet.

What I’ve done so far:

I’ve updated my .htaccess file within /var/www/ to include the above .htaccess text suggested by Wordpress.

Steps I’ve taken so far, based on previous help within these forums:

  1. I’ve changed the permissions for the .htaccess file several times. I’ve tried chmod -v 666 and chmod -v 766 and chmod -v 777. After each chmod, I’ve submitted the ‘service apache2 restart’ command. None of these permission changes have worked. For security reasons, my last permission change has been: chmod -v 666 .htaccess. I’ve run ‘ls -alt .htaccess’ to confirm that the changes have been made to allow the file to be read and writable.

  2. I’ve accessed the apache2.conf file and changed all ‘AllowOverride none’ instances to say ‘AllowOveride all’. I’ve then submitted the command: ‘service apache2 restart’ to confirm the changes were made.

  3. I’ve include the following to the /etc/apache2/sites-available/000-default.conf file:

<Directory “/var/www/html”> AllowOveride all </Directory>

And again submitted the command, ‘service apache2 restart’ to confirm changes.

However, I still receive the same error whenever I try to update the permalink option within the Wordpress panel.

Does anyone have any other suggestions? I’ve googled as much as I can. Any additional help would be GREATLY appreciated.

Thanks,

Richard



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Just to add another experience. I also found that editing /etc/apache2/apache2.conf so that ‘allowoveride’ were all set to ‘all’ worked for me. After restarting apache the links worked instantly.

I’ll try the double save option - thanks for the tip. What a strange ‘bug’!

Also, I’ve already enabled rewrite - however, should I do this command at a certain level? I think previously I’ve done this in the /var/www folder - perhaps I should go up to root? Does it make a difference?

Also, a couple more points:

  1. In my /etc/apache2/apache2.conf file, the Servername is that of the droplet’s ip address NOT ‘localhost’ - does this matter? Some fixes suggest including: Servername localhost

  2. I have no html folder or file in my /var/www folder - some of the coding within the apache2.conf points to /var/www/html. Why is this?

  3. Should I try defining the site_url within wp-config? If so, how would I do this?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.