WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 404 Page (17 posts)

  1. robertallen
    Member
    Posted 1 year ago #

    I noticed the default template has the 404.php inside of it. I heard that it's best and more SEO friendly to have the 404 file in the root directory. Is this true? If so, does anyone know a good plugin that will do this?

  2. esmi
    Forum Moderator
    Posted 1 year ago #

  3. robertallen
    Member
    Posted 1 year ago #

    Thank you for the reply. It didn't specifically tell me if it was best to put it in the root directory. By best, I mean SEO friendly.

    Do you happen to know? I already wound up creating my own 404.php...just wasn't sure to keep it in the theme folder or program it to the root directory.

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    It didn't specifically tell me if it was best to put it in the root directory.

    All theme template files are added to your theme's template folder inside wp-content/themes.

  5. Thank you for the reply. It didn't specifically tell me if it was best to put it in the root directory. By best, I mean SEO friendly.

    I've never heard of this being better for SEO.
    SEO is based on content. Focus on good content and the seo will follow.

  6. esmi
    Forum Moderator
    Posted 1 year ago #

    The important thing is that the correct headers are sent so that Google knows that the page is missing. That's what the example in the page I linked to above does.

  7. diypublic
    Member
    Posted 1 year ago #

    I'm trying to create an Error 404 Page with Easel theme.
    I think I have tried everything now buy cannot get it to work.
    http://speedingticketfixer.com/page/5/
    Can anybody help me with this?

  8. robertallen
    Member
    Posted 1 year ago #

    Have you tried copying the page.php theme in your theme folder and make it 404.php?

    Inside the file there's an area that says something like:
    <?php the_content('Read more...'); ?>

    Replace it with a 404 Error message.

  9. diypublic
    Member
    Posted 1 year ago #

    worth a try, will get back to you, thanks

  10. diypublic
    Member
    Posted 1 year ago #

    yes there is already a 404.php in the Easel Theme folder

  11. robertallen
    Member
    Posted 1 year ago #

    Try this...

    To ensure the server finds your 404 page, add the following line to your .htaccess file:

    ErrorDocument 404 /index.php?error=404

  12. diypublic
    Member
    Posted 1 year ago #

    Where would I put this line?
    ErrorDocument 404 /index.php?error=404

    This is what I see below:

    ----------------------------------------------------------------
    # -FrontPage-
    DirectoryIndex index.php index.html index.htm
    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
    
    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName speedingticketfixer.com
    AuthUserFile /home/speepcqf/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/speepcqf/public_html/_vti_pvt/service.grp
    
    DirectoryIndex index.php index.html index.htm
    #Redirect 301 /index.html http://speedingticketfixer.com/index.php
    
    # BEGIN W3TC Browser Cache
    <IfModule mod_deflate.c>
        <IfModule mod_headers.c>
            Header append Vary User-Agent env=!dont-vary
        </IfModule>
            AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
        <IfModule mod_mime.c>
            # DEFLATE by extension
            AddOutputFilter DEFLATE js css htm html xml
        </IfModule>
    </IfModule>
    <FilesMatch "\.(css|htc|js|js2|js3|js4|CSS|HTC|JS|JS2|JS3|JS4)$">
        <IfModule mod_headers.c>
             Header set X-Powered-By "W3 Total Cache/0.9.2.10"
        </IfModule>
    </FilesMatch>
    <FilesMatch "\.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|HTML|HTM|RTF|RTX|SVG|
    SVGZ|TXT|XSD|XSL|XML)$">
        <IfModule mod_headers.c>
             Header set X-Powered-By "W3 Total Cache/0.9.2.10"
        </IfModule>
    </FilesMatch>
    <FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|
    gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v
    |mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot
    |pps|
    ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|
    xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EOT
    |EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|JSON|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP
    4|M4V|MPEG|MPG|MPE|MPP|OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|PO
    T|PPS|PPT|PPTX|RA|RAM|SVG|SVGZ|SWF|TAR|TIF|TIFF|TTF|TTC|WAV|WMA|WRI|X
    LA|XLS|XLSX|XLT|XLW|ZIP)$">
        <IfModule mod_headers.c>
             Header set X-Powered-By "W3 Total Cache/0.9.2.10"
        </IfModule>
    </FilesMatch>
    # END W3TC Browser Cache
    # BEGIN WordPress
    
    # END WordPress
    -----------------------------------------
  13. robertallen
    Member
    Posted 1 year ago #

    You can essentially put it anywhere, but try putting it between BEGIN and END WordPress. I'm no .htaccess expert, but I think that might work.

  14. diypublic
    Member
    Posted 1 year ago #

    Yes it WORKED. Than you very very much.
    Regards
    Les

  15. robertallen
    Member
    Posted 1 year ago #

    Woo hoo! Glad I could help and that it worked. You're most welcome.

  16. Frederick Townes
    Member
    Posted 1 year ago #

    @robertallen, can you mark this thread as resolved?

  17. robertallen
    Member
    Posted 1 year ago #

    Sorry about that. I completely forget to do that. I'll do better next time.

Topic Closed

This topic has been closed to new replies.

About this Topic