The home page of my wordpress website seems to be displaying correctly but if you click through to any of the other pages I get the following error message:
Hie,
Although late If anybody suffering from the similar issues here is what you can do to allow permalinks by modifying your virtual host file or whereever you are hosting your WP sites.
So basically everything works fine - you set up permalinks to post and suddenly the url dissapears. You went to a lot of disscussion forums (Like me) tried a lot of modifying and got "Permission to server 403" errors or URL not found error. All you have to do is go to the host file, for example 000-default.conf if using a default virtual host or your config file inside sites-enabled,
use in the directory section :
<Directory "path/to/dir">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Donot use the following inside directory
Order allow,deny
Allow from all
The Order and Allow directives are deprecated in Apache 2.4.
Likewise you can setup the directory in /etc/apache2/apache2.conf set the directory for your path and donot use the above - this will cause permission 403 error.
In addition to that you will need to enable mod_rewrite for apache
I found a very simple solution.
Now, all pages URLs in WordPress should work perfectly.
You can return the URL to the previous setting and the WordPress will re-generate the URL correctly. I choose Post name in my case and it works fine.
I got the same issue. My home page can be accessed but the article just not found on the server.
Go to cpanel file manager > public_html
and delete .htaccess
.
Then go to permalink setting in WordPress, set the permalink to whatever you want, then save. viola everything back to normal.
This issue occurred after I updated WordPress.
There is a trusted answer on the Wordpress website:
Where's my .htaccess file?
WordPress's index.php and .htaccess files should be together in the directory indicated by the Site address (URL) setting on your General Options page. Since the name of the file begins with a dot, the file may not be visible through an FTP client unless you change the preferences of the FTP tool to show all files, including the hidden files. Some hosts (e.g. Godaddy) may not show or allow you to edit .htaccess if you install WordPress through the Godaddy Hosting Connection installation.
Creating and editing (.htaccess)
If you do not already have a .htaccess file, create one. If you have shell or ssh access to the server, a simple touch .htaccess command will create the file. If you are using FTP to transfer files, create a file on your local computer, call it 1.htaccess, upload it to the root of your WordPress folder, and then rename it to .htaccess.
You can edit the .htaccess file by FTP, shell, or (possibly) your host's control panel.
The following permalink rewrite code should be included in your .htaccess file (since WordPress 3.0):
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
*Taken from here.
I used http://jafty.com/blog/enable-mod_rewrite-on-apache-ec2-linux-server/ to determine that after upgrading to PHP 5.6 (from 4.9.13) it also update the http (Apache) and I needed to edit the /etc/httpd/conf/httpd.conf file, I quote...
Basically, you’ll be adding All insted of None to AllowOverride, you do not want to edit the main directory configuration, you want to edit the one that looks like this:
<Directory “/var/www/html”>
Not:
<Directory />
Then restart Apache with:
sudo service httpd restart
NOTE - in my tiredness I did change a different Directory element and it made no difference, so ensure you do it for /var/www/html
The article also explains how to check mod-rewrite is enabled.
The selected answer didn't solve this issue for me. So for those still scratching their head over this one, I found another solution!
In my Apache settings httpd.conf
(you can find the conf file by running apachectl -V
in your console), enabled the following module:
LoadModule rewrite_module modules/mod_rewrite.so
And now the site works as expected.