1

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/

5
  • 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
    Commented Dec 12, 2012 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
    Commented Dec 12, 2012 at 22:35
  • so apparently mod rewrite was not enabled. i enabled it but now there my pages say "forbidden 403"
    – paolo
    Commented Dec 12, 2012 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
    Commented Dec 13, 2012 at 2:38
  • Also, the Codex is your friend ;)
    – brasofilo
    Commented Dec 13, 2012 at 2:44

2 Answers 2

0

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.
0

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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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