Support » Plugin: Google XML Sitemaps » [Plugin: Google XML Sitemaps] How do you remove trailing slashes from file?

  • Hello, I am pissed because I noticed the XMl Sitemaps plug in appends a trailing slash to every single file, including My web server, hostgator, does a 301 redirect from to But the fact the sitemap includes the / leads me to believe something is going to get screwed.

    Another issue I noticed is that wordpress seems to append trailing slashes onto everything.

    Question 1) How To Remove Traling Slashes from XML Sitemap
    Question 2) How to Remove Trailing Slahes from all wordpress pages.
    Question 3) Does google determine the name of your page by the sitemap or by the webserver? I don’t see how google could put in my for my home page because that is 301 REDIRECTED! How is this possible?

Viewing 1 replies (of 1 total)
  • you’re pissed? That’s quite a way to start a post asking for help 😛

    Nonetheless, I will help 🙂

    open sitemap-core.php.

    Go to line 284.

    You see this:

    $r.= "\t\t<loc>" . $this->EscapeXML($this->_url) . "</loc>\n";

    Change this one line to the following two lines:

    $hack_url = substr($this->_url,-1,1) == '/' ? substr($this->_url,0,-1) : $this->_url;
    $r.= "\t\t<loc>" . $this->EscapeXML( $hack_url ) . "</loc>\n";

    Hopefully this solution works and you won’t be “pissed” at me too. 😉

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Google XML Sitemaps] How do you remove trailing slashes from file?’ is closed to new replies.