• I just did a clean install of a multisite (network) using subdomains. Everything worked great, but I noticed that going to https://domain.com/anything.php would get me a generic “not found” page instead of the “WordPress 404” page. Also, when going to https://domain.com/wp-admins/ would return a 503 error. My htaccess is:

    1. # add a trailing slash to /wp-admin
    2. RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    
    3. RewriteCond %{REQUEST_FILENAME} -f [OR]
    4. RewriteCond %{REQUEST_FILENAME} -d
    5. RewriteRule ^ - [L]
    6. RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    7. RewriteRule ^(.*\.php)$ $1 [L]
    8. RewriteRule . index.php [L]

    Removing lines 6 and 7 will eliminate the problem. After searching the forum I found that those lines are there (I think) to prevent a 503 error some people were reporting, but I think line 2 does the same thing (the redirect loop is caused by not having the trailing slash at the end).

    I deleted those lines. I have been testing and found no problems, but I wonder if it is safe to simply remove them from my htaccess file. If anybody has experienced this or if there is something I am missing, please let me know so I put those lines back. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Yes it’s safe to remove them, you don’t need them and it isn’t necessary to use .htaccess to add a trailing slash, WP takes care of that automatically.

    As for your 404 page, did your Theme come with one? Some do, some don’t, but if you don’t have one you can create one and upload it, just be sure it’s named exactly 404.php.

    There are a number of tutorials online on how to create a great 404 page, ideally it should offer site visitors a way to search for the content they expected to find, maybe a link to your sitemap if you have one (a user-friendly one that is, not an XML one for search engines), maybe a link to your contact page even if it’s in your menu.

    If you DO have a 404.php file in your Theme folder and it’s not being served properly, post back as there is a few lines you can add to your .htaccess file to force that, it just shouldn’t be necessary.

    Thread Starter Jose Manuel Sanchez

    (@josemanuelsh)

    Thank you for you answer Trisha. I DO have one, and by removing those lines it shows as it should. So far everything is working fine without those lines.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not getting the 404 WordPress page’ is closed to new replies.