Real Physical Media has moved files in your media library and created redirects from the old URL to the new URL, but they don’t work? We explain in which cases this can happen and how to solve the problem.
Cases where redirects do not work
If you take a look at your Real Physical Media SEO redirects and none of your redirects are working as expected, most likely the configuration of your web server (Apache2 or NGINX) is wrong.
You know the redirect is not working when you open the old URL and see a plain white screen with an “Error 404” or a very technical screen. The main problem is that your web server is not forwarding the request to your WordPress instance. That’s why the rule to redirect to the new URL can never be applied.
Solution for Apache2 web server
It is recommended to make the following changes only if you are a technician and know what you are doing! If not, please forward this article to your hosting provider or server admin.
Please connect to your WordPress installation via FTP and open the file .htaccess
. It contains some lines if code like the following:
# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress
This is an example and can differ from your .htaccess
file. In this case, we need to add the following lines on top of the file:
# Multisite needs a custom 404 redirect (soft redirect, see also https://stackoverflow.com/a/41824195/5506547)
ErrorDocument 404 /index.php
Solution for NGINX web server
It is recommended to make the following changes only if you are a technician and know what you are doing! If not, please forward this article to your hosting provider or server admin.
You need to redirect all error 404 request to the index.php
file in your root directory. Afterwards, WordPress can take care to show the correct page (or SEO redirect) for the request. Add the following line to your server
configuration to redirect the requests.
error_page 404 /index.php;