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:
Not Found
The requested URL /about was not found on this server.
Apache/2 Server at www.wildlionmedia.co.uk Port 80
I'm not sure whether it's a problem with the theme or the .htaccess file that is not being rewritten correctly.
http://www.wildlionmedia.co.uk/
Any ideas how I can resolve the issue?
# Switch rewrite engine off in case this was installed under HostPay.
RewriteEngine On
SetEnv DEFAULT_PHP_VERSION 53
DirectoryIndex index.cgi index.php
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine Off
RewriteBase /wildlionmedia.co.uk/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wildlionmedia.co.uk/index.php [L]
</IfModule>
# END WordPress
If all above point not work. Then try this one. I tried it. It's working for me.
UPDATE 2017
For new versions of apache the file is called apache2.conf
So to access the file, type sudo nano /etc/apache2/apache2.conf and change the correspondent line inside block
<Directory /var/www >
I deleted the previous .htaccess file and created new one by clicking on save button in Settings->Permalinks
and now that pages started working fine...
FWIW: I rebuilt a LAMP server from scratch and installed WordPress. I had the same issue after saving my Permalink setting to generate the .htaccess file. Turns out that mod_rewrite was not enabled. I ran across this post on Digital Ocean.
FTA:
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 runningapachectl -V
in your console), enabled the following module:LoadModule rewrite_module modules/mod_rewrite.so
And now the site works as expected.
It worked for me like this:
Go to Wordpress Admin Dashboard > “Settings” > “Permalinks” > “Common settings”, set the radio button to “Custom Structure” and paste into the text box:
and click the Save button.
Make sure mode_rewrite is enabled in APACHE settings. See link here https://github.com/h5bp/server-configs-apache/wiki/How-to-enable-Apache-modules
Then make sure you have correct .htaccess https://wordpress.org/support/topic/404-errors-with-permalinks-set-to-postname/
And correct virtual host settings in either Apache settings How to Set AllowOverride all