Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Whenever I change my permalink option from the default to /%postname%/, it results into my page cannot be found.

Wordpress would complain that it cannot modify the .htaccess (because there was none), so I created it in /var/www/. The .htaccess has the same owner / permissions as my wordpress folder.

Please help, I've been trying to fix this for 3 days now.

Do I also need to change the mod_rewrite somewhere?

EDIT:

Solved!

inside /var/www/.htaccess Add the line: Options +FollowSymLinks

for the mod_rewrite problem:

Check for Apache Mod_ReWrite – Following lists all the loaded modules

sudo apache2ctl -M Enable Mod_Rewrite

sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load Restart Apache view sourceprint? 1 sudo /etc/init.d/apache2 restart

courtesy of https://usingnix.wordpress.com/2010/12/21/apache-mod_rewrite-wp-permalinks/

share|improve this question
    
You don't 'change' mod_rewrite, really, but it needs to be enabled on the server and you need to have AllowRide All or (if I remember right) AllowOveride File in the server configuration. Are those conditions met? –  s_ha_dum Dec 12 '12 at 22:24
    
I went to my /etc/apache2/httpd.conf. I'm suppose to uncomment a mod_rewrite line there but, my httpd.conf is empty except for one line: ServerTokens Prod. There are no other commented lines. Also where should I edit the AllowRide All –  paolo Dec 12 '12 at 22:35
    
so apparently mod rewrite was not enabled. i enabled it but now there my pages say "forbidden 403" –  paolo Dec 12 '12 at 22:51
    
Hi, paolo, you should add the Answer as a new... Answer. Not in the body of the Question, thanks and welcome! –  brasofilo Dec 13 '12 at 2:38
    
Also, the Codex is your friend ;) –  brasofilo Dec 13 '12 at 2:44
add comment

2 Answers 2

I think there is enough information to make an answer. Really, only barely a WordPress questions but here you go.

First, be aware that the query-string format-- ?p=, ?s=, etc-- should always work.

This is for an Apache(2) server.

  1. mod_rewrite must be enabled
  2. AllowOverride All or at least AllowOverride File must be set
  3. The .htaccess file must be properly created. WordPress will write the file if it can, otherwise go to the wp-admin->Settings->Permalinks, and save the permalinks. If WordPress complains that it can't write the .htaccess file then copy what WordPress tells you into .htaccess manually. This is a required part of the process.
  4. Check the permissions.
share|improve this answer
add comment
up vote 0 down vote accepted

Solved!

inside /var/www/.htaccess Add the line: Options +FollowSymLinks

for the mod_rewrite problem:

Check for Apache Mod_ReWrite – Following lists all the loaded modules

sudo apache2ctl -M Enable Mod_Rewrite

sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load Restart Apache view sourceprint? 1 sudo /etc/init.d/apache2 restart

courtesy of https://usingnix.wordpress.com/2010/12/21/apache-mod_rewrite-wp-permalinks/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.