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
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 :
Donot use the following inside directory
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
Here is another version for Wordpress, original one did not work as intended.
Reference from this Github repository, modified a bit. After excessive testing this rule does not solve all problems. We have a Wordpress webshop, which has 40 plugins and somewhere is there a rewrite clash. I sincerely hope next version of Wordpress has no URL rewrites.
The
^
signifies start of the string,\
escapes.
or it would mean any character, and$
signifies end of the string.^index\.php$
if http(s)://hostname/index.php-
do nothing[END]
flag can be used to terminate not only the current round of rewrite processing but prevent any subsequent rewrite processing.In
RewriteCond
using$1
as a test string references to captured contents of everything from the start to the end of the url http(s)://hostname/bla/bla.php. If used in substitution or condition it references to captured backreference.RewriteRule (bla)/(ble\.php)$ -
for http(s)://hostname/bla/ble.php capturesbla
into$1
andble.php
into$2
. Multiple capture groups can be accessed via$3..N
.( )
groups several characters into single unit,?
forces the match optional.[OR]
flag allows you to combine rewrite conditions with a logical OR relationship as opposed to the default AND.In short, if bla/bla.php contains index.php OR next condition
( )
groups several characters into single unit,|
separates characters to subgroups and conditions them if any one of.[NC]
flag causes the RewriteRule to be matched in case-insensitive manner.In short, if bla/bla.php ends with any of the filetypes OR next condition
Server-Variables are variables of the form %{ NAME_OF_VARIABLE } where NAME_OF_VARIABLE can be a string taken from the following list:
%{REQUEST_FILENAME}
is full local filesystem path to the file or script matching the request, if this has already been determined by the server at the time REQUEST_FILENAME is referenced. Otherwise, such as when used in virtual host context, the same value as REQUEST_URI. Depending on the value of AcceptPathInfo, the server may have only used some leading components of the REQUEST_URI to map the request to a file.-f
check for regular file. Treats the test string as pathname and tests whether or not it exists.In short, if bla/bla.php is a file OR next condition
-d
check for directory. Treats the test string as a pathname and tests whether or not it exists.In short, if bla/bla.php is a directory
This statement is only executed when one of the condition returned true.
.
match any character*
zero or more times.The
[S]
flag is used to skip rules that you don't want to run. The syntax of the skip flag is[S=N]
, whereN
signifies the number of rules to skip (provided the RewriteRule matches). This can be thought of as a goto statement in your rewrite ruleset. In the following example, we only want to run the RewriteRule if the requested URI doesn't correspond with an actual file.In short, do nothing
The
[L]
flag causes mod_rewrite to stop processing the rule set. In most contexts, this means that if the rule matches, no further rules will be processed. This corresponds to the last command in Perl, or the break command in C. Use this flag to indicate that the current rule should be applied immediately without considering further rules.In short, rewrite every path as http(s)://hostname/index.php
I fetched this little doc together from apaches.org documentation. Links below.
That's not a typical Wordpress rewrite block. This is:
See http://codex.wordpress.org/Using_Permalinks#Where.27s_my_.htaccess_file.3F
The easiest and fastest thing to do it reset your permalinks in Dashboard>>Settings>>Permalinks and make sure .htaccess is writable so WordPress can write the rules itself.
And: are you aware you are calling
index.cgi
as your default document rather thanindex.php
? That's wrong. Removeindex.cgi
. Or try removing the whole line, too, because defining a default doc on your server may not be needed.**Solved Permalink Issue Wordpress ** 1) Login to wordpress dashboard > click on settings > premalinks > then select post name. 2) After that login to your hosting server goto .htaccess file and replace the code.
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.
I got this solution from this link
Although solution to this problem is hardly coded in regeneration of your .htaccess file; indeed it din't worked for most of you specially when the site is migrated to some new server.
Let's dive into some basics.
Let's assume that for most of us, WordPress environment is running on a PHP server APACHE where this server is controlling most of our environment's initial dependencies. Meanwhile .htaccess generation is also mainly dependent on Apache configurations.
So if that been said, the contribution of .htaccess creation conflict mainly occurs when a WordPress website is migrated from a server running the WordPress environment on old version of Apache and PHP to a newer version of PHP and Apache.
Because dependencies of nrwer and older versions are different that's why the newer version of Apache2 won't allow the .htaccess directives to create a .htaccess file by default; because of which we have to manually set the WordPress website's root directory permissions from "AllowOverride None" to "AllowOverride All".
Comparatively, AllowOverride directive is used to allow the use of .htaccess within the web server to allow overriding of the Apache config on a per directory basis.
Use the following fix to change the apache2.conf directory permission settings:
How to deal with GCP WordPress error "This page isn’t working example.com is currently unable to handle this request. HTTP ERROR 500