• Resolved curious11

    (@curious11)


    Hello!

    Firstly, thank you very much for looking into this.

    Secondly, my situation is this:

    I have a WP installation in its own sub-dir on my server. I also have the the index.php and .htaccess files moved to the root dir. As you may expect, I did this so that my blog can be accessed by https://www.domain.com or domain.com.

    Now, regardless of whether I choose the blog’s domain to have or not have the www domain prefix, whatever the URL is not set to in the settings panel in the Dashboard… will bring up an error.

    For example, if in the WordPress Address box I have: https://www.domain.com/blog and then in the Blog Address box I have https://www.domain.com, going to https://www.domain.com works fine. However, going to domain.com brings up the following error:

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/i/n/d/indecisiveian1/html/index.php:1) in /home/content/i/n/d/indecisiveian1/html/blog/wp-includes/pluggable.php on line 850

    Now, I’ve looked for any extra spaces in the index.php file… haven’t found any. I’m not sure how to rectify this situation.

    Essentially, I would like to have the site accessible at either url, which would mean I need a redirect of some kind. I’ve tried different approaches with the .htaccess file, but have had the same error pop up, so I reverted it to the default.

    Help! I implore you!

Viewing 15 replies - 1 through 15 (of 18 total)
  • /home/content/i/n/d/indecisiveian1/html/index.php

    you edited that file, right? to change the path to wp-blog-header.php, per the codex?

    you introduced hidden characters or line breaks when you edited it. that you dont “see” them is why theyre called hidden.

    Upload an identically edited index.php, taking care to use a plain text editor, and not some MS word apps to edit it, or just remove the hidden stuff you introduced.

    Thread Starter curious11

    (@curious11)

    Yep, right now it’s the following:

    <?php
    /**
     * Front to the WordPress application. This file doesn't do anything, but loads
     * wp-blog-header.php which does and tells WordPress to load the theme.
     *
     * @package WordPress
     */
    
    /**
     * Tells WordPress to load the WordPress theme and output it.
     *
     * @var bool
     */
    define('WP_USE_THEMES', true);
    
    /** Loads the WordPress Environment and Template */
    require('./blog/wp-blog-header.php');
    ?>

    I did take care to edit in notepad and save as UTF-8, so I’m not sure that’s the issue.

    ..so I’m not sure that’s the issue.

    clearly then, you dont need the help of anyone with 4 years experience. ill just point you to the documentation.

    https://codex.www.ads-software.com/Answers-Troubleshooting#Headers_already_sent

    best of luck.

    Thread Starter curious11

    (@curious11)

    clearly then, you dont need the help of anyone with 4 years experience. best of luck.

    ? I don’t really understand how I offended you, but I do apologize.

    Regardless, thanks for your time!

    EDIT: I did try rewriting in notepad and saving again as per your suggestion, and it didn’t change the situation. This is why I said I don’t think that’s the issue.

    I’ve also seen that page in the codex and tried it out. Unfortunately, it didn’t do the trick either.

    im not offended, Im simply telling you that there are limited causes for that error, and the fact that you are editing it, regardless of a redo, supports my remarks.

    put wordpress in its own directory, with an unedited index.php..

    what happens?

    Thread Starter curious11

    (@curious11)

    I do realize the point your making. What’s frustrating for me is that I’ve tried the suggestions you and others have made to no avail.

    Let me just iterate what the issue is, so that I’m sure we’re on the same page.

    Problem:

    Visiting: https://www.domain.com (works fine).
    Visiting: https://domain.com (produces the error).

    Visiting: https://domain.com (produces the error).

    and is that ALL thats seen? does the content display under the error at all?

    whats being returned in the headers? I cant check because you dont want to share the domain, obviously.

    Visiting: https://www.domain.com (works fine).

    the correct content shows up?

    Thread Starter curious11

    (@curious11)

    Visiting: https://www.domain.com

    Yep, correct content shows up.

    Visiting: https://domain.com

    Shows the error and only the error on a blank white page.

    Feel free to have a look here.

    Excuse the mess.

    ok, and what do you see when you look in firefox?? I assume you arent or you might have mentioned seeing it… I see the hidden char right on that page.

    <html><head></head><body>???<br />  <---------------
    <b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/content/i/n/d/indecisiveian1/html/index.php:1) in <b>/home/content/i/n/d/indecisiveian1/html/blog/wp-includes/pluggable.php</b> on line <b>850</b><br />
    </body></html>

    furthermore, its also seen as your page loads at the www. url, youve just cached the content so youre no longer seeing it. I saw it, right as the page loaded.

    I can prove it by directing you here:

    https://www.ianborges.com/feed

    ??

    what does this tell me? it tells me that there are hidden characters before the opening <?php in your edited index.php, like I said an hour or so ago ??

    the ONLY other possibility is that its being caused by a plugin file with the same problem, and since we know youve edited the file I keep mentioning …

    Thread Starter curious11

    (@curious11)

    It just doesn’t make sense! I’ve edited the same index.php file, from the original, a variety of times, trying different things, etc. and still the chars?

    I’ve used jedit as well and there are still hidden chars?!

    I’m going to have another look at it and will take a look at the plugin files as well.

    actually, i forgot, its telling you the file in the error, you can skip looking at plugins.

    Btw, if you have shell access you can see the hidden stuff by cat’ing the file:

    # cat index.php

    Thread Starter curious11

    (@curious11)

    Thanks for your help, thus far.

    I’ve inadvertantly caused another problem, thereby causing a headache and a desire to smash.

    For the sake of my notebook, I’m going to let this sit for the night.

    Thanks for your help, thus far.

    I’ve inadvertantly caused another problem, thereby causing a headache and a desire to smash.

    For the sake of my notebook, I’m going to let this sit for the night.

    youre welcome. if you email me the file, Ill fix it for you ??

    whoo at mydomain.com where mydomain.com is actually village-idiot.org

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Header error b/c of no www prefix.’ is closed to new replies.