Forum Replies Created

Viewing 1 replies (of 1 total)
  • First and foremost: None of what I am about to say is meant to be rude. I am just trying to help anyone who may come across this topic in the future.

    Now then – I’m not sure what you did to resolve your issue, but to future readers, do not do anything that you read/see above. I can hardly make sense of the logic used.

    I replaced my web link with ../ because I thought that...

    Stop right there.

    1. A good rule of thumb is, if you dont actually know what something does, dont implement it. WordPress could not possibly make it easier to create an inline link. Select your text, click the “link” button in the editor, and select your destination page. Then, if you change your domain in the future, WordPress handles the internal linking switcheroo on its own. Dont use ./ or ../. See here for more clarification https://stackoverflow.com/questions/7591240/what-does-dot-slash-refer-to-in-terms-of-an-html-file-path-location

    2. These days, the use of target=”_blank” is generally frowned upon due to security concerns and poor UX. Don’t use it, and especially dont use it for internal linking.

    may have something to do with Yoast sitemap as well because I guess it all started when I set the sitemap and put the links in my robot.txt

    3. The correct file is robots.txt – not robot.txt. Even if you put it in a robot.txt, WordPress automagically creates and serves a basic robots.txt when it detects a request for one when one does not currently exist.

    4. Dropping all of those sitemap links in your robots.txt file is entirely redundant, as /sitemap_index.xml contains all of the sub-sitemaps already. Unless you have specific reasons to change your robots.txt, and you know what the implications are, your robots.txt file should really contain nothing more than:

    User-agent: *
    Disallow: /wp-admin/
    Allow: /wp-admin/admin-ajax.php

    5. Dont:
    or maybe I should redirect the all to my home page using this in my theme 404.php file...

    A 404 error means that a bot could not find a file at the linked destination. So, in order to do what you said you wanted to do (the redirect), you would have to manually create all of the non-existent files. Which, would then actually make the 404 error go away because now the file would exist. But then you would direct the crawler back to the homepage with a header that said the file in fact now did NOT exist…… What a nightmare.

    When your server detects a request for a file that does not exist, the server will serve your 404 page in place of the missing file. A 404 error and a 404 page are two entirely different things.

    I could go on but I’ll just end with this – do not edit your theme files. Create a child theme instead. It is so simple to do https://codex.ww.wp.xz.cn/Child_Themes (or at least simpler than fixing all of the issues you will cause by editing your theme files directly).

Viewing 1 replies (of 1 total)