Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

404 error after changing permalinks wordpress

Tags:

php

wordpress

My site is a Wordpress-site created with PHP.

I have made changes in permalink default to postname. It works fine in Chrome and Firefox but not in IE8. The front page displays correctly but when I click a link to another page, it shows a 404 page not found error.

I'm using Wordpress version 3+.

.htaccess file is

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress

where WordPress is folder name. also in apache rewrite_module is enable

like image 986
Sagardevd Avatar asked Jun 20 '13 06:06

Sagardevd


People also ask

How do I fix 404 errors after changing WordPress Permalinks?

Switch the Permalinks Setting This is where you go to your WordPress Dashboard → Settings → Permalinks. Then, you need to choose Post Name and click on the button Save Changes. Yes, that's all.

What happens if you change a permalink in WordPress?

Remember, once you publish a post or page, the URL (permalink) is then cached and indexed by Google and other search engines. Thus, if you choose to change the URL on a page or post in WordPress, it can disrupt that indexing.

When I change Permalinks it is not working in WordPress?

Reset permalink settings Just open your WordPress dashboard and go to Settings → Permalinks. Make sure the permalink structure of your choice is selected. If it's already done, you don't need to change anything. Then scroll down to the end of the page and hit the Save Changes button.


2 Answers

First put a .htaccess file in your /var/www/ folder and make it writable. Second, suppose your wordpress blog is in /var/www/blog folder then go to /etc/apache2/sites-available/ and make following changes in default file

<Directory /var/www/>
    Options +ExecCGI 
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
</Directory>
<Directory /var/www/blog/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
</Directory>

Now restart apache to make sure changes have taken effect. Hope it helps.

like image 179
Winchester Avatar answered Sep 29 '22 10:09

Winchester


After trying all of these answers and the instructions on codex.wordpress.org, I needed to enable mod_rewrite on Apache: https://stackoverflow.com/a/5758551/728287

like image 29
Gianfranco P. Avatar answered Sep 29 '22 11:09

Gianfranco P.