Create a 404 page / prevent Theme from redirecting to index
-
Hello :)
I'd like to have a custom 404 page. Unfortunately this dosen't seam to be possible since LayTheme (or wp) is redirecting wrong links to the index page.This is my .htaccess file - I think the problem is the part after #END WordPress with the 301
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
I know I need to add something like this:
ErrorDocument 404 /not-found-page.php
And probably need to delete the rewrite Engine stuff, but I am scared.
Could someone help me?
Kind regards,
Markus -
hey you can create a file called "404.php" in lay themes folder "wp-content" → "themes" → "lay"
however, every time you update lay theme that file will be deleted
or you could try and find a 404 wordpress plugin
other than that, please contact your webhost about htaccess questions, its not lay theme related
-
Alright, Thank you @arminunruh !
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it