WEB Wordpress sitemap.xml question

Discussion in 'OT Technology' started by Falconer, Apr 17, 2009.

  1. Falconer

    Falconer OT Supporter

    Joined:
    Jun 23, 2006
    Messages:
    65,506
    Likes Received:
    1
    Alright so I just converted my site into WP format.

    My previous sitemap.xml file was made with an online sitemap generator. Its URL is http://www.mydomain.com/sitemap.xml. Google likes this and it's in Google Webmaster Tools.

    With WP, now the URLs of all my articles have changed. I have a sitemap.xml generator plugin, but because of how WP works, its address is http://mydomain.com/sitemap.xml

    WP doesn't use the www prefix, and when I tried to manually add it in in WP dashboard, WP locked me out and was trying to access http://.mydomain.com (with the dot in front) which obviously didn't return anything.

    Ok, so my question is, Google Webmaster Tools allows you to specify the location of your sitemap.xml file, but it forces you to use the www prefix. Since my sitemap file doesn't have the www prefix now that i'm on WP, how do I tell Google Webmaster Tools where it is?

    Intuitively I would think it wouldn't matter whether or not you used the www, but if I got to mydomain.com/sitemap.xml, I see a nicely formatted sitemap, and if I go to www.mydomain.com/sitemap.xml, I see a fucked up txt looking document. Question part 2: why is there a difference? Aren't www.mydomain.com/sitemap.xml and mydomain.com/sitemap.xml the same location??
     
  2. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
  3. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    this is the beauty of wordpress there is a plugin for EVERYTHING.
     
  4. fishbulb

    fishbulb Active Member

    Joined:
    Oct 29, 2001
    Messages:
    6,848
    Likes Received:
    4
    Location:
    md
    Google is probably preventing you from adding a sitemap w/o www. because your site is defined as www.domain.com. If you set up a new site in webmaster tools as domain.com, it should let you.

    I do most of my sites w/o the www and 301 any www. request to the non www domain. This is good for SEO, so in effect links to your site are counted towards to same credit, whether or not they have www. on the front. You can do it the other way around ( use the www. and 301 links without the www, but just pick one scheme for your internal links, etc and be consistent with it. )

    Here's what you add to your .htaccess file at the top if you want to do that:
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC]
    RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
    
    This will require mod-rewrite be turned on in Apache, but it generally already is

    As for why one sitemap looks different than the other, that's a bit puzzling. Must be an XSLT issue? When you view the source are they both exactly the same?

    By the way if you just want to make WP work with the www. in the front, open up your database, look at the wp_options table, and browse the table. Browse for records with option_name 'siteurl' and 'home'. Add www. to your url there and it that should fix it.
     
    Last edited: Apr 17, 2009
  5. Falconer

    Falconer OT Supporter

    Joined:
    Jun 23, 2006
    Messages:
    65,506
    Likes Received:
    1
    Last edited: Apr 17, 2009
  6. Falconer

    Falconer OT Supporter

    Joined:
    Jun 23, 2006
    Messages:
    65,506
    Likes Received:
    1
    I hadn't thought of that. I will try and see what happens.

    I still don't understand why there's a difference between www.domain.com and domain.com, however. I thought that everything was technically www.domain.com and if you were lazy and didn't put the www in the URL as you type it into the address bar, your browser would just add it for you because it's always implied :dunno:

    I would pick "with www" but WP won't allow that :squint: When I tried to change it, it completely crashed my site and I had to have hostgator tech support walk me through how to fix it because I couldn't access anything.

    I don't know what XSLT is.

    Yes, they both look the same when you view source.

    But if you open them in a window, the one without www looks like this:
    And if you go to the URL of the one WITH the www, it looks like this:

    That's how I crashed my site before. I tried it twice in two separate domains, and each time it resulted in me being completely unable to access anything on my site because it would say "cannot access http://.domain.com", like it was ingoring the www but not the dot that followed.

    :dunno:
     
  7. Spaceering

    Spaceering I bite.

    Joined:
    Dec 26, 2008
    Messages:
    755
    Likes Received:
    0
    Location:
    Texas
    there is another plugin for wp from what i understand. where you can set it so that it can be either "http://www.yoursite.com" or "http://yoursite.com"


    i saw this in a post someone made somewhere on ot, possibly the webmaster lab. but a quick search and I could not find it.


    maybe the person that made the post can remember. but basically the guy said with this you have it where it is set to one or the other. so if you have it set to http://www.yoursite.com then when someone goes to http://yoursite.com, it wont work

    but fuck, im beating myself up b/c i cant find the post now. this forum is too big :o
     
  8. Falconer

    Falconer OT Supporter

    Joined:
    Jun 23, 2006
    Messages:
    65,506
    Likes Received:
    1
    right now if someone goes to www.mysite.com it redirects to mysite.com

    I want it so it doesn't matter which one the person goes to. People use www by default.

    Actually, I just checked, and even using www.mysite.com/article will redirect to mysite.com/article. So that's good. I guess I'll just leave it this way since it seems to work even tho it's a wtf issue or me.

    I just wanna make sure Google can read my sitemap ok.
     
  9. Falconer

    Falconer OT Supporter

    Joined:
    Jun 23, 2006
    Messages:
    65,506
    Likes Received:
    1
    omg, I just checked my other WP site and it allowed me to change everything to www.

    I so do not understand WP. I do the same exact thing on 3 separate domains and 2 of them crash and deny me access and one of them works fine. And I know in all cases I followed the exact same steps in the exact same order because I have a list written down of exactly what I do in what order, and I followed it for each of my sites.
     
  10. 07

    07 18-1

    Joined:
    Jun 26, 2006
    Messages:
    4,933
    Likes Received:
    0
    It is the host.


    Unless you have some crazy shit already in your htaccess.
     
  11. Falconer

    Falconer OT Supporter

    Joined:
    Jun 23, 2006
    Messages:
    65,506
    Likes Received:
    1
    They're all hosted on the same hostgator account :dunno:
     
  12. fishbulb

    fishbulb Active Member

    Joined:
    Oct 29, 2001
    Messages:
    6,848
    Likes Received:
    4
    Location:
    md
    It's gotta be a plugin or something outside of wordpress, I've moved tons on sites in that fashion. You could try disabling all of your plugins and then make the switch.
     
  13. Falconer

    Falconer OT Supporter

    Joined:
    Jun 23, 2006
    Messages:
    65,506
    Likes Received:
    1
    The switch was the very first thing I did before I installed any plugins.

    I don't really care since www's get redirected to no-www's, I just wanted to understand why.

    I also want to make sure Google can read my sitemap.

    I link to http://domain.com/sitemap.xml in the footer on every page. Will that work in lieu of being able to submit it to Google Webmaster Tools?
     

Share This Page