I just installed Drupal in a sub directory on my website to use as a Blog. http://www.danfinney.com/blog/

Everything is running and working well. I submitted the XML feed url to Google Webmaster tools as a Sitemap. Google successfully downloaded the feed but tossed the following warning:

URLs not followed
When we tested a sample of URLs from your Sitemap, we found that some URLs redirect to other locations. We recommend that your Sitemap contain URLs that point to the final destination (the redirect target) instead of redirecting to another URL.

HTTP Error: 301 (Moved permanently)
URL: http://www.danfinney.com/blog

I did some investigating and figured out what the problem was. The feed url http://www.danfinney.com/blog/rss.xml is indicating the base path of the site without the trailing slash:

alternateURL="http://www.danfinney.com/blog"
base href="http://www.danfinney.com/blog"

When you go to: http://www.danfinney.com/blog it redirects you to include the trailing slash: http://www.danfinney.com/blog/

I am using the Global Redirect module, but the "remove trailing slash" feature does not seem to work on the main directory.

I also tried to edit settings.php so that the feed would include the trailing slash in the urls, but my attempts were not successful.

I either need to change the base path to include the trailing slash, or I need the trailing slash removed. Can someone point me in the right direction?

Comments

danfinney’s picture

I am not really sure if this is a Global Redirect issue, or a core XML feed issue. Any input would be great.

danfinney’s picture

When I turn Global Redirect off I still seem to have the issue. Does anyone know how I can set the Base URL in the RSS feed to have a trailing slash in the path?

danfinney’s picture

Adding a $50 bounty for the first person to provide the solution to this issue.

jainrutgers’s picture

I don't know how you are submitting your xml sitemap to major search engines.

Try using (if you had not used ) xml sitemap module. It submit your sitemaps to major search engines very smoothly.

http://drupal.org/project/xmlsitemap

Chetan
http://www.cjain.com

danfinney’s picture

It is actually not the Site Map that is the problem. The XML feed that Drupal Generates can be submitted as a Site Map in Webmaster tools. The problem is the feed located at http://www.danfinney.com/blog/rss.xml shows the location of the blog at http://www.danfinney.com/blog instead of http://www.danfinney.com/blog/

This is causing Google to toss a Redirect Error notice as http://www.danfinney.com/blog is redirected to http://www.danfinney.com/blog/

jainrutgers’s picture

hmm...go to your settings.php file and check that you don't have trailing slash in front of your base url

$base_url = 'http://www.example.com'. (NO trailing slash)

Also look at this article if it helps you

http://tips.webdesign10.com/drupal-modules/drupals-global-redirect-modul...

Google for 'trailing slash drupal sitemap problem' (this will help you for sure)

Once you find solution please write back to this and help others.

Thanks

Chetan
http://www.cjain.com

danfinney’s picture

Thanks Chetan, I have been all over Google on this one. The only thing I have been able to dig up is issues with paths when Drupal is installed in a subdirectory. I did try adding the trailing slash in settings.php to see what would happen (even though it clearly says no trailing slash). It did add the slash to the RSS XML but it cause the paths to show up like: danfinney.com/blog//blogpost

jainrutgers’s picture

Dan - I will try to duplicate your problem on my website and will let you know if i find something.

Chetan
http://www.cjain.com

danfinney’s picture

I reformatted my Redirects in the .htaccess file and resubmitted the feed to Google WT. I got an "OK" this time in the Sitemaps section. I am still showing a "URL not crawled" flag on the URL: http://www.danfinney.com/blog but it is still dated May 1, 2009. I am removing the bounty until I see if this has fixed the error or not.

danfinney’s picture

Bah! The URL warning came back.