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:
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.
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.
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!
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:
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
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?
Should I try defining the site_url within wp-config? If so, how would I do this?
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.